先说你的第一个程序:#include <stdio.h>
void main ()
{
char a,b,c;
scanf("%c%c%c",&a,&b,&c);
a=z;
*( z未被定义,也就不能被使用)
if(b>z); *(if 语句后面不能带“;”)
b=z;
if(c>z);
c=z;
printf("%c",z);
}
第二个程序:#include <stdio.h>
void main ()
{
int number = 0;
printf("\nEnter an integer between 1 and 10: ");
scanf("%d",&number);
if(number> 5)
*(“>”号使用错误)
printf("You entered %d which is greater than 5\n",number);
if(number < 5) *(此处的if 语句应改为
else)
printf("You entered %d which is less than 6\n",number);
正确代码:
void main ()
{
int number = 0;
printf("\nEnter an integer between 1 and 10: ");
scanf("%d",&number);
if(number>5)
printf("You entered %d which is greater than 5\n",number);
else
printf("You entered %d which is less than 6\n",number);
以后有什么问题 就加我编程群吧
108668542