#include <iostream>
// #include <stdlib.h> // You dont need this
using namespace std;
// This program reads in five numbers, find their sum, then prints the numbers in reverse.//
int main ()
{
const int numlist = 5;
int num[ numlist];
int total = 0 ; // Remember to initialize variables
int numcount;
for (numcount = 0; numcount < numlist; numcount++)
{
cout << "Enter number " << numcount << ": ";
cin >> num[numcount];
}
for ( int i =0; i< numlist; i++)
{
total = total + num[i];
}
cout << "\nThe total of the numbers are: " <<total << endl;
// To Print the numbers in reverse
for ( int i =numlist - 1 ; i>=0; i--)
{
cout << num[ i ] << endl;
}
return 0;
}
WolfPack 491 Posting Virtuoso Team Colleague
SpS commented: Nice Post:Sunny +1