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 advantages of VB.NET?
what are the advantages and diadvantages of active reports over crystal reports ?
what is diffrence constructor and destructor in vb
How is VB.Net different from VB6?
How can we remove handlers at run time?
What is "Polymorphism" and what are Polymorphism in VB.Net?
What is static member?
Name some of the features of C# which are not present in VB.NET?
hello! I am developing software in vb6 and vb.net separately which i need to generate barcodes e.g i have a string "182346-u",so the problem is that how to generate barcode from this type of string can any body help me please thanks regard !
Before in my vb app I would just load the icons from dll. How can I load the icons provided by .net dynamically?
Why Datareader is useful?
i have attended interview for cognizant ( 3 +,on .net ) on 19-06-2010 till now i have not given the status ..am confused... does any one faced same situation ...could please tell what would be happened