So, what I'm making here is a program where users enter the input, then the output is displayed of what the user entered. As you can see, I am attempting to use array method but I didn't succeed like what I expected. Anything missing beyond my knowledge?
#include <iostream>
usingnamespace std;
int main()
{
int a, b, c;
cout<<"Enter viewers aged 2>5: "<<endl;
cin>>a;
cout<<"Enter viewers aged 7>17: "<<endl;
cin>>b;
cout<<"Enter adult viewers: "<<endl;
cin>>c;
int viewer[3]={a, b, c};
cout<<"Viewers aged 2>5: ";
cout<<viewer[0]<<endl; // MOVE LINE FEED TO AFTER THE OUTPUT
cout<<"Viewers aged 7>17: ";
cout<<viewer[1]<<endl; // MOVE LINE FEED TO AFTER THE OUTPUT
cout<<"Adult viewers: ";
cout<<viewer[2]<<endl; // MOVE LINE FEED TO AFTER THE OUTPUT
return 0; // NOT NECESSARY IN main()
}