admin@onlinelearningcenter.in (+91) 7 999 01 02 03

Create array of size 10, Insert 5 values and insert 6 at pos 2

Kopal Jaiswal
382 Posts

Write a program to create a new array of size 10.

Insert 5 elements in it. {1,2,3,4,5,0,0,0,0,0}

Insert element 6 at position 2. {1,2,6,3,4,5,0,0,0,0}

 

Remember index starts from 0,So position 2 means 3rd element.

Output: Hide 0's

{1,2,6,3,4,5}

 

 

 

Published By : Kopal Jaiswal
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.

Comments

Jquery Comments Plugin