Breaking News
recent

WAP to display elements of an array

#include<iostream.h>
#include<conio.h>
void main()
{                       
int a[10],i,n;
cout<<"enter the no. of element : ";
cin>>n;
cout<<"Enter the elements :"<<endl;
for(i=0;i<n;i++)
{
cin>>a[i];
}
cout<<"Elements of the array are : "<<endl;
for(i=0;i<n;i++)
{
cout<<"a["<<i<<"]"<<"="<<a[i]<<endl;
}

getch();
}

Output:


Unknown

Unknown

No comments:

Post a Comment

Powered by Blogger.