Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...


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.

Answers were Sorted based on User's Feedback



Write a program that accepts an array of numbers, and two numbers (an element and a position in th..

Answer / 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

Write a program that accepts an array of numbers, and two numbers (an element and a position in th..

Answer / lince

Dim num() As Integer = {5, 3, 6, 7, 1}
num.SetValue(3, 2)

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More VB.NET Interview Questions

described weak typing?

0 Answers  


How many ways the function can return values?

0 Answers  


What is the relation between Garbage collector and finalize and destructor?

2 Answers   Kanbay,


What is intermediate language in .NET ?

20 Answers   Digital GlobalSoft,


1234 123 12 1 how to design above pic in vb.net?

2 Answers   ABC,






Which namespace are used for accessing the data?

0 Answers  


Explain private assembly?

0 Answers  


Which properties are used to bind a DataGridView control?

0 Answers  


What is CLR?

20 Answers   Horizon Computers, Microsoft,


List the two main parts of .net?

0 Answers  


What is the Difference between Web User Control and Web Custom Control?

6 Answers   Benchmark,


What is the use of assembly?

0 Answers  






Categories