Answers for "quiz score calculator c++"

C++
0

quiz score calculator c++

#include <iostream>
using namespace std;
int main()
{
int item[5]; //Declares an array item of five components.
int sum, counter;
cout<<"Enter five numbers: ";
sum = 0;
for (counter = 0; counter <5; counter++)
{

cin>>item[counter];
sum = sum + item[counter];
}
cout<<endl;
cout<<"The sum of the numbers is:"<<sum<<endl;
cout<<"The number in reverse order are: ";
//Print the numbers in reverse order

for(counter=4;counter >=0;counter--)
    cout<<item[counter]<<" ";
cout<<endl;
return 0;
}
Posted by: Guest on August-21-2021

Browse Popular Code Answers by Language