10 numbers are first stored in array and then the array is displayed.
This should be your first array program.
Select To use this code as it is.. select and copy paste this code into code.cpp file :)
- #include<iostream.h>
- #include<conio.h>
- void main()
- {
- clrscr();
- int ar[10];
- cout<<"Enter array element: "<<endl;
- for(int i=0;i<10;i++)
- //Coding by: Snehil Khanor
- //http://WapCPP.blogspot.com
- {
- cout<<"Enter element "<<i<<": ";
- cin>>ar[i];
- }
- cout<<"Elements of array: "<<endl;
- for(i=0;i<10;i++)
- cout<<"Element at index number "<<i<<" is: "<<ar[i]<<endl;
- getch();
- }
0 comments:
Post a Comment