1035: C language - the output gap
topic describes
write a function, enter a four-digit number, the required output of these four numeric characters, but spaces between every two numbers. 1990 as input, the output should be "1990."
Enter
a four-digit
output
increase in output space
sample input
1990
Sample Output
1990
# include<stdio.h>
int main()
{
int a,x[100],i=0,j;
scanf("%d",&a);
while(a>0)
{
x[i]=a%10;
a/=10;
i++;
}
for(j=i-1;j>=0;j--)
{
printf("%d ",x[j]);
}
return 0;
}