Y
yky
in this programme,if i input a number 100,the program will be over ,and i
donot have the chance to input a char to z;
# include<stdio.h>
main()
{
int x;
char z;
do
{printf("please input a number between 1 and 100\n");
scanf("%d",&x);
if(x==58)
{printf("exellent\n");
exit();}
else if(x-58>-5&&x-58<0)
printf("it is a little smaller\n");
else if(x-58<5&&x-58>0)
printf("it is a little bigger\n");
else if(x-58<-5||x-58>5)
printf("it is much away\n");
}while(x<100&&x>1);
puts("press any key");
z=getchar();
putchar(z);
}
donot have the chance to input a char to z;
# include<stdio.h>
main()
{
int x;
char z;
do
{printf("please input a number between 1 and 100\n");
scanf("%d",&x);
if(x==58)
{printf("exellent\n");
exit();}
else if(x-58>-5&&x-58<0)
printf("it is a little smaller\n");
else if(x-58<5&&x-58>0)
printf("it is a little bigger\n");
else if(x-58<-5||x-58>5)
printf("it is much away\n");
}while(x<100&&x>1);
puts("press any key");
z=getchar();
putchar(z);
}