hi I need a program in C++ that returns the number by only integers; for exmaple if you input a numbre X= 43756, the program will show:
6
5
7
3
4
and it will also show the number:
4
3
7
5
6.
Please someone help me
hi I need a program in C++ that returns the number by only integers; for exmaple if you input a numbre X= 43756, the program will show:
6
5
7
3
4
and it will also show the number:
4
3
7
5
6.
Please someone help me
Try this:
/* let n be the input variable */
while (n != 0) {
num = n % 10; // gives the last digit
arr[i++] = num; // store result in an array
n /= 10;
}
/* print the array. You get the first output. Print it in reverse and you get the
* second output
*/
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.