View Code of Problem 54

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

Double click to view unformatted code.


Back to problem 54