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
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 |
Answer / lince
Dim num() As Integer = {5, 3, 6, 7, 1}
num.SetValue(3, 2)
Is This Answer Correct ? | 0 Yes | 0 No |
What is the difference between .dll extension and .exe extension files?
Explain about visual basic.net?
What is writeline in vb.net?
what is delegates
give me code for selecting itemcode and correspondin vendor details wll displays in the gridview?
What is difference between import system.data.sqlclient,system.data.oledb?
Can you please explain the difference between thread and process?
How do you validate Date by using which validation Control?
Explain jagged array in vb.net?
The default back end of the VB is
Name the class which allows an element to be accessed using unique key?
What is the maximum size of the textbox?