Q:

C++ Program To Print Element Of An Array

belongs to collection: Array Programs In C++ Programming

0

Write A Program To Print Element Of An Array

Logic :-

 Just take a input from user and print all the element of array 

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

#include<iostream>
using namespace std;
int main()
{
  int n,a[50],i;
 
  cout<<"Enter The Size Of Array: \n";
  cin>>n;
 
  cout<<"Enter The Element Of Array: \n";
  for(i=0;i<n;i++)
  {
   cin>>a[i];
 }
 
  cout<<"Output Of Array: ";
  for(i=0;i<n;i++)
  {
   cout<<a[i]<<"  ";
 }
 return 0;
}

 

Output:

Enter The Size Of Array: 

6

Enter The Element Of Array: 

10

20

30

40

50

60

Output Of Array: 10  20  30  40  50  60  

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

C++ Program To Reverse An Array And Sum Of Its Ele... >>