View Code of Problem 54

#include<stdio.h>
#include<string.h>
int main()
{
    int n,a[100],i=0;
    scanf("%d",&n);
    while(n!=0)
    {
        a[i++]=n%10;
        n=n/10;
    }
    for(int j=i-1;j>0;j--)
        printf("%d ",a[j]);
    printf("%d",a[0]);
    return 0;
}

Double click to view unformatted code.


Back to problem 54