105k views
0 votes
Write a C++ Program to read 2 grades from the keyboard ( Math and Physics ) .

User Baldrickk
by
9.0k points

1 Answer

7 votes
cin is discouraged, so I'd go with:

string math, physics;
getline(cin, math);
getline(cin, physics);

of course, parsing needs to happen to verify that a correct grade was typed...
User Rujmah
by
8.2k points