write a program to insert an element into an array

Answer Posted / saranya

#include<iostream.h>
#include<conio.h>
void main()
{
int a[5],i;
clrscr();
cout<<"enter the element to be inserted into an array";
for(i=0;i<5;i++)
{
cin>>a[i];
}
for(i=0;i<5;i++)
{
cout<<a[i];
}
getch();
}

Is This Answer Correct ?    21 Yes 50 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why is c++ awesome?

580


What is stoi in c++?

704


What is class invariant in c++?

750


Write a program which is required to process the time of a clock in hours and minutes, entered from the keyboard. With this program, there are two requirements for any data entered by a user: 1. The data must be of the correct type (in this case, two ints). 2. The data must be in the correct range: this means that, for the minutes, negative numbers and any number above 59 must be rejected; for the hours, negative numbers and any number above 23 must be rejected. Output error message for invalid data input. Output the time one and a half hour after the time input. i.e. Hour: 22 Min: 32 One and a half hour after 22:32 is 00:02

1514


What is a class definition?

615






What is the standard template library (stl)?

626


What are pointer-to-members? Explain.

636


What is math h in c++?

609


What are guid?

691


How can an improvement in the quality of software be done by try/catch/throw?

594


How much maximum can you allocate in a single call to malloc()?

637


Are vectors faster than arrays?

571


What does ios :: app do in c++?

557


What is static class data?

579


Explain the auto storage classes in c++.

605