一段程序 请高人指点

来源:百度知道 编辑:UC知道 时间:2024/06/15 10:48:09
写出CHAR型变量CH为小写字母的C语言表达式
#include<stdio.h>
main()
{char ch,ch1;
printf("the upper case is %c\n" ch1);
ch=ch1+`a`-`A`;
printf("the lower case is %c\h" ch);
}

写出C语言表达式;int型数X的取值为0或1 且float型数Y 的取值在1.0~6.0之间的C语言表达式
#include<stdio.h>
main()
{int a=1 b=0 c=1.0 d=6.0;
int x;
float y;
printf("a=%d,b=%d\n", a,b);
x=a‖x=b;
printf("c=%f,d=%f\n",c,d);
y>=c&&y<=d;
}
上面的式子对么请高手指教 感激不尽

如果不对能否 给个正确的答案 谢谢

void main ( )
{
char ch,ch1='S';
printf("the upper case is %c\n",ch1);
ch=ch1+'a'-'A';
printf("the lower case is %c\n",ch);
}

#include<stdio.h>
main()
{
int x;
float y;
printf("输入x:");
scanf("%d",&x);
printf("输入y:");
scanf("%f",&y);
if (x==0 || x==1) printf("x=%d,符合要求\n",x);
else printf("x=%d,不符合要求\n",x);
if (y>1.0 && y<6.0) printf("y=%f,符合要求\n",y);
else printf("y=%f,不符合要求\n",y);
}