Question: 1. Write a C++ program that will read in any positive integer value (not string) and print the digits out in reverse order. Examples: Input
1. Write a C++ program that will read in any positive integer value (not string) and print the digits out in reverse order. Examples:
Input a positive integer: 1234
Reversed: 4321
Input a positive integer: 1
Reversed: 1
Input a positive integer: 624578
Reversed: 875426
-------------------------------------------------------------------------------------------------------------------------------------------
2. Rewrite the following while loop as an equivalent for loop.
int i = 1;
int total = 0;
while( i < 100 )
{
total += i;
i++;
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
