View Code of Problem 54

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

Double click to view unformatted code.


Back to problem 54