Monday, May 24, 2010

What owuld this lookd like in C++ code?

A program that reads ten numbers (in an array) and displays them in reverse order in which they are read.

What owuld this lookd like in C++ code?
#include %26lt;iostream%26gt;


using namespace std;


int main( int, char **)


{


int i, ary[10];


for (i = 0; i %26lt; 10; ++i)


cin %26gt;%26gt; ary[i];


for (i = 0; i %26lt; 10; ++i)


cout %26lt;%26lt; ary[ 9 - i ];


cout %26lt;%26lt; endl;


return 0;


}
Reply:It could look very similar to a program written in C to do the samething. Shouldn't you do your own homework? At lease give it a try and ask for help.


No comments:

Post a Comment