Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Write a program that accepts an array of numbers, and two
numbers (an element and a
position in the array) and inserts the given element into
nth position of the array.

Answer Posted / surabhi

void main()
{
int x[6],item,pos,i,n;
printf("\n enter no of elements to be inserted:");
scanf("\n %d",&n);
for(i=0;i<n;i++)
{
printf("\n enter elements:");
scanf("%d",&x[i]);
}
printf("\n enter item to be inserted:");
scanf("%d",&item);
printf("\n enter position:");
scanf("%d",&pos);
for(i=n;i<=pos-1;i--)
{
x[i+1]=x[i];
}
x[pos-1]=item;
printf("\n elements after insertion:");
for(i=0;i<=n;i++)
{
printf("\n %d",x[i]);
}
getch();
}

Is This Answer Correct ?    3 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which properties are used to bind a DataGridView control?

1187


Explain how to store decimal data in .net?

1219


What is the source code for display the picture in button click event?

1196


What languages does the .net framework support?

1043


Is it necessary to have SQL server installed in your computer in order to create a service based database in vb.net?

2419


Which control is an example of an object in vb net?

7008


how many server control present in .net

2806


Is vb.net a programming language?

1029


Tell us how many languages are supported by .net?

973


Explain the difference between thread and process?

1062


What are the parts of the visual basic control?

1000


Can you please explain the difference between dataset and datareader?

1075


Explain the advantages of vb.net?

1008


What are the difference between dispose(), close(), exit(), end()? When do we use them?

1074


What do you mean by Redim in VB.NET?

1230