can output 5 students using one dimensional array

Answer Posted / hari haran

#include<iostream.h>
void main()
{
int a[5];
for(int i=0;i<n;i++)
{
cin>>a[i];
}
for(int i=0;i<n;i++)
{
cout<<"
"<<a[i];
}
}

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does new do in c++?

632


Why do we use structure in c++?

571


How does com provide language transparency?

601


What are the three forms of cin.get() and what are their differences?

627


Show the application of a dynamic array with the help of an example.

582






What is the difference between method overloading and method overriding in c++?

557


What do you mean by persistent and non persistent objects?

732


How would you implement a substr() function that extracts a sub string from a given string?

562


How is c++ different from java?

558


What is the difference between passing by reference and passing a reference?

557


What is auto type c++?

625


Can we inherit constructor in c++?

584


What is token c++?

574


What is void pointer in c++ with example?

594


What is an arraylist c++?

687