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

thak you Mr Govind for replying to my question. My next question is that how to retrieve image stored in an SQL server table and assign it to any image control or picture control using VB.net

0 Answers  


described weak typing?

0 Answers  


hey friends, Firstly I pick the records from the database into the DataGridView, Then I want that If I made any changes to the records in the GridView & Click on Update Button, Changes are Reflected into the main Database .Plz do reply back

4 Answers  


What is the advantages of VB.NET?

0 Answers   NA,


Explain the use of option explicit?

0 Answers  






What is the difference between c# and vb.net?

0 Answers  


Name some of the keywords used in vb.net?

0 Answers  


What are the objects in asp.net and tell the purpose of those objects

3 Answers   Ascent, CCS, MTBC,


ColumnMapping belongs to which namespaces?

1 Answers  


Is VB.NET object oriented? What are the inheritances does VB.NET support ?

13 Answers   Digital GlobalSoft, Global Infotech, Infosys,


What are the difference between dispose(), close(), exit(), end()?

0 Answers  


Name and explain some of the exclusive features which are present in vb?

0 Answers  


Categories