10/31/2015

C++ Program To Print Element Of An Array

Problem :- Write A Program To Print Element Of An Array

Logic :- Just take a input from user and print all the element of array after that you can reverse check how C++ Program To Reverse An Array Sum Of Its Element

Solution :-

#include<iostream>
using namespace std;
int main()
{
//By-Ghanendra Yadav 
  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:-


C++ Program To Print Element Of An Array

Previous Post
Next Post

post written by:

Hi, I’m Ghanendra Yadav, SEO Expert, Professional Blogger, Programmer, and UI Developer. Get a Solution of More Than 500+ Programming Problems, and Practice All Programs in C, C++, and Java Languages. Get a Competitive Website Solution also Ie. Hackerrank Solutions and Geeksforgeeks Solutions. If You Are Interested to Learn a C Programming Language and You Don't Have Experience in Any Programming, You Should Start with a C Programming Language, Read: List of Format Specifiers in C.
Follow Me

0 Comments: