How to construct ac++ program that will read up to ten(10) letters into an array. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to construct ac++ program that will read up to ten(10) letters into an array.

write the letter back to the screen in the reverse order. use a period as sentinel value to make the end of the input. For example ,if the input is Happy then the output should be yppaH

1st Jan 2017, 4:58 PM
fatinfarhanah
3 Answers
0
int a[100]; int i=0; for (i=0;i<=9;i++) { cin>>a[i]; }
1st Jan 2017, 5:18 PM
Rishabh Bhatnagar
Rishabh Bhatnagar - avatar
0
ooo.
1st Jan 2017, 5:24 PM
Rishabh Bhatnagar
Rishabh Bhatnagar - avatar
0
Sry I got the whole exercise wrong. First you input in a char array, like Rishabhs' code is doing it (grr for printing complete solutions) reverse it by going through I=9 to 0 in your input array and add the chars to your result string then output.
1st Jan 2017, 5:34 PM
Andreas K
Andreas K - avatar