View Code of Problem 54

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

Double click to view unformatted code.


Back to problem 54