View Code of Problem 54

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

Double click to view unformatted code.


Back to problem 54