Ask Question
24 February, 22:08

Write the C+ + statement to declare and initialize a 5-element, one-dimensional integer array named grades. Use the following grades to initialize the array: 100 90 80 78 98. Then write the C+ + code to display the contents of the array on the screen using a 'for" loop.

+5
Answers (1)
  1. 24 February, 22:33
    0
    int grades[5] = { 100, 90, 80, 78, 98 };

    for (int i=0; i<5; i++)

    {

    cout << grades[i];

    }
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Write the C+ + statement to declare and initialize a 5-element, one-dimensional integer array named grades. Use the following grades to ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers