Q
questions
when I type 12456,it will give me "1 2 4 5 6".But when the integer
is too great ,for example ,if I type 78965,it will not give me "7 8
9 6 5",but give me a wrong result,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;}
is too great ,for example ,if I type 78965,it will not give me "7 8
9 6 5",but give me a wrong result,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;}