mivec
06-03-2004, 07:39 AM
hie, i am quite new to C++..and i can't get this thing done..it's something like that:
Quote:
A program that reads 10 integers (from 1 to 99 inclusive) and prints the first and last on one line, the second and the ninth on the second line, the third and the eighth on the next line, and so forth. It should look like the following sample.
Please enter 10 numbers:
10 31 2 73 24 65 6 87 18 9
Your numbers are:
10 9
31 18
2 87
73 6
24 65
[/QUOTE]
and also how can i make it like the user can input the 10 numbers randomly from 1-99?that means the 10 numbers are not fixed as seen above.something like the below(i am not sure about the code so i am just assuming):
int numbers[10];
printf("Enter 10 numbers");
scanf("d% d% d% d% d% d% d% d% d% d%", &numbers[10]);
can someone pls help me?i know it's kinda simple but i am new in C++.....if possible, is there a code for this simple programme? :(
Quote:
A program that reads 10 integers (from 1 to 99 inclusive) and prints the first and last on one line, the second and the ninth on the second line, the third and the eighth on the next line, and so forth. It should look like the following sample.
Please enter 10 numbers:
10 31 2 73 24 65 6 87 18 9
Your numbers are:
10 9
31 18
2 87
73 6
24 65
[/QUOTE]
and also how can i make it like the user can input the 10 numbers randomly from 1-99?that means the 10 numbers are not fixed as seen above.something like the below(i am not sure about the code so i am just assuming):
int numbers[10];
printf("Enter 10 numbers");
scanf("d% d% d% d% d% d% d% d% d% d%", &numbers[10]);
can someone pls help me?i know it's kinda simple but i am new in C++.....if possible, is there a code for this simple programme? :(