Please write the whole program for 55 rating Let n be a posi


Please write the whole program for 5/5 rating.

Let n be a positive integer consisting of up to 10 digits, d10, d9, ..., d1. Write a program to list in one column each of the digits in the number n. The right-most digit, d1, should be listed at the top of the column. Hint: If n is 3,704, what is the value of the digit when computed by using digit = n % 10; Test your program for values of n equal to 6; 3.704; and 170,498.

Solution

#include <stdio.h>
#include <stdlib.h>

int main()
{
long num;
printf(\"Enter the number\");
scanf(\"%lu\",&num);

while(num>0)
{
printf(\"\ %lu\",num);
num=num/10;
}

return 0;
}


Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site