Create a program that will allow user to enter 10 names od teacher A's students to be stored in array name stud_name then display vertically
#include <iostream>
#include <string>
using namespace std;
int main() {
string stud_name[10];
int i;
cout << "Enter 10 names od teacher A's students: " << endl;
// storing information
for( i = 0; i < 10; ++i) {
cout<<i+1<<". ";
getline(cin, stud_name[i]);
}
// display information
cout<<endl<<"Students: "<<endl;
for( i = 0; i < 10; ++i)
cout<< stud_name[i]<<endl;
return 0;
}
Comments
Leave a comment