View Code of Problem 54

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

Double click to view unformatted code.


Back to problem 54