View Code of Problem 54

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

Double click to view unformatted code.


Back to problem 54