Q
questions
Tell me what fault it is ?
when I type 12345,it'll give me "1 2 3 4 5",but when the integer I
type in is too great ,it'll not give me what I want.For example,if I
type 78569,I want to get "7 8 5 6 9",but the result is
wrong.why?????
#include<stdio.h>
int main()
{ int x,y,z,m,n,w;
printf("Give me an integer\n");
scanf("%d",&x);
y=x/10000;
z=x%10000/1000;
m=x%1000/100;
n=x%100/10;
w=x%10;
printf("%d %d %d %d %d",y,z,m,n,w);
return 0;}
when I type 12345,it'll give me "1 2 3 4 5",but when the integer I
type in is too great ,it'll not give me what I want.For example,if I
type 78569,I want to get "7 8 5 6 9",but the result is
wrong.why?????
#include<stdio.h>
int main()
{ int x,y,z,m,n,w;
printf("Give me an integer\n");
scanf("%d",&x);
y=x/10000;
z=x%10000/1000;
m=x%1000/100;
n=x%100/10;
w=x%10;
printf("%d %d %d %d %d",y,z,m,n,w);
return 0;}