Little man computer Input 5 numbers and output them in reverse order?
2014-02-27 09:21:16 UTC
I'm finding it extremely difficult to program this "program that will input 5 numbers and then output them in reverse order?" Help, thankyou need this today.
// or alternately you could use another for loop like this:
for (int i = 0; i < 5; i++)
cout << iNumber[i] << " ";
cout << endl;
return 0;
}
smith
2017-01-19 05:25:09 UTC
1
2015-08-19 11:51:49 UTC
This Site Might Help You.
RE:
Little man computer Input 5 numbers and output them in reverse order?
I'm finding it extremely difficult to program this
"program that will input 5 numbers and then output them in reverse order?"
Help, thankyou need this today.
Robert G
2014-02-27 09:26:15 UTC
Use an array to store the numbers with a for loop. Increment the loop from 1 to 5 for input. Use another for loop with a decrementing counter to display.
Veo
2014-02-27 09:31:49 UTC
#include
#include
#include
int main(int argc, char *argv[]) {
long int i0 = argc>1 ? strtol(argv[1],NULL,10) : 0;
long int i1 = argc>2 ? strtol(argv[2],NULL,10) : 0;
long int i2 = argc>3 ? strtol(argv[3],NULL,10) : 0;
long int i3 = argc>4 ? strtol(argv[4],NULL,10) : 0;
long int i4 = argc>5 ? strtol(argv[5],NULL,10) : 0;