0

How to print an array to the screen in c++?

I need the full array.

25th Aug 2017, 1:36 AM
Abinash Kumar Nayak
Abinash Kumar Nayak - avatar
4 Respostas
+ 10
#include<iostream> using namespace STD; int main(){ int a[5],i; cout<<"Enter 5 elements"; for(i=0;i<5;i++) cin>>a[i]; cout<<"Entered array is:"; for(i=0;i<5;i++) cout<<a[i]; return 0; }
25th Aug 2017, 2:48 AM
P R
P R - avatar
+ 6
Sorry for the wait Here is a foreach loop example - it automaticly lists the entire array https://code.sololearn.com/cWP33Pz6Jp8x/?ref=app
25th Aug 2017, 3:16 AM
Manual
Manual - avatar
25th Aug 2017, 2:48 AM
Sreejith P
Sreejith P - avatar
+ 2
With for and cout
25th Aug 2017, 2:21 AM
Daniel
Daniel - avatar