Advertisement
Guest User

Untitled

a guest
Aug 17th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. const int ClassSize = 5;
  5.  
  6. int main(){
  7. cout << "Enter each of the students scores at a time.\n";
  8. int id = 1;
  9. int score[ClassSize];
  10. while (id <= ClassSize) {
  11. cout << "Enter student " << id << " score: ";
  12. cin >> score[id-1];
  13. id++; //id = id+1
  14. }
  15. //id = 1;
  16. //while(id <= ClassSize) {
  17. //cout << score[id-1] << " ";
  18. //id++
  19. // }
  20. for(int i = 1; i<=ClassSize; i++)
  21. cout << score[i-1] << " ";
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement