Pages

Saturday 19 March 2011

PROGRAM TO PRINT ELEMENTS OF ARRAY

PROGRAM-:
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int n,a[20],i;
cout<<"enter the number of element in array"<<"\n";
cin>>n;
cout<<"enter the elements of array"<<"\n";
for(i=0;i<n;i++)
{
cin>>a[i];
}
cout<<"entered elements of array are";
for(i=0;i<n;i++)
{
cout<<"a["<<i<<"]="<<a[i]<<"\n";
}
getch();
}

0 comments:

Post a Comment

 
Copyright (c) 2010 Concepts Of C++. Design by WPThemes Expert

Blogger Templates and RegistryBooster.