- Home
- Course Category
- Course Result
- Course Detail
Hot Line: 0124-2383121
Course Introduction
Programs for practice
In the program below, we print One Dimensional Array in C++
Source Code: Print One Dimensional Array
/* C++ Program - One Dimensional Array*/ #include<stdio.h> #include<conio.h> void main() { clrscr(); int arr[50], n; cout<<"How many element you want to store in the array ? "; cin>>n; cout<<"Enter "<<n<<" element to store in the array : "; for(int i=0; i<n; i++) { cin>>arr[i]; } cout<<"The Elements in the Array is : \n"; for(i=0; i<n; i++) { cout<<arr[i]<<" "; } getch(); }Output
How many element you want to store in the array ? 5 Enter 5 element to store in the array : 1 3 4 5 6 The Elements in the Array is : 1 3 4 5 6