View Code of Problem 54

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

Double click to view unformatted code.


Back to problem 54