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

What is the advantages of VB.NET?

0 Answers   NA,


what are the advantages and diadvantages of active reports over crystal reports ?

1 Answers   IBM, Kotak,


what is diffrence constructor and destructor in vb

0 Answers   MCN Solutions,


How is VB.Net different from VB6?

7 Answers   Ksb,


How can we remove handlers at run time?

0 Answers  


What is "Polymorphism" and what are Polymorphism in VB.Net?

2 Answers  


What is static member?

0 Answers  


Name some of the features of C# which are not present in VB.NET?

0 Answers  


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 !

2 Answers  


Before in my vb app I would just load the icons from dll. How can I load the icons provided by .net dynamically?

0 Answers  


Why Datareader is useful?

5 Answers  


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

1 Answers  


Categories