44问答网
所有问题
if(ch1)>='a'&&ch1<='z'ch1=ch1-32; error C2143: syntax error : missing ';' before '>=' 加上分号不对
如题所述
举报该问题
其他回答
第1个回答 2016-05-21
正确的语法是:if(条件){语句}else{语句}你的程序中if语句相当与执行了第9,10行,第11行算是if语句外面的了,然后再跟else语句就会报错正确的是:#includemain(){charch1,ch2;scanf("%c",&ch1);if('a'<=ch1&&ch1<='z'){ch2=ch1-32;printf("%c",ch2);}elseprintf("2");}懂了吗?
第2个回答 2016-05-20
括号错了
if(ch1>='a'&&ch1<='z')ch1=ch1-32;
本回答被网友采纳
相似回答
C语言编程中,调试出现
error
C2143:
syntax
error : missing ';' befor...
答:
if(
i<=100000)cash=a;else if(i<=200000)cash=b;else if(i<=400000)cash
=c;
else if(i<=600000)cash=d;else if(i<=1000000)cash=e;else if(1000000<i)cash=f;//你声明的是double类型,请使用"%lf",而不是"%f",还有最好加个回车 printf("本月奖金应发:%10.2lf\n",cash);ret...
输入一个字符,判断其是否为小写字母,如果是小写字母就将其转换为大写...
答:
并且你定义另外一个ch2是没有必要的,直接对ch1操作就可以了,
ch1-=
32
...{char ch; while(
(ch=
getchar(
))
!='\n') {
if
答:
abcDEF
关于C语言编程
error
C2143:
syntax
error : missing ';' before 'cons...
答:
修改后的完整代码:include<stdio.h>#include<math.h>int main(){ int a,b,gewei,shiwei,baiwei,qianwei,wanwei; printf("请输入一个不多于五位的正整数: "); scanf("%d",
&a);
while(a<0||a>=99999) { printf("输入错误请重新输入"); scanf("%d",&a); }
if(a
>=0
&&
...
大家正在搜
相关问题
c语言错误error C2143: syntax error...
while((ch1=getchar())!='\n')的用...
error C2143: syntax error : mi...
c语言ch1=ch1-32;ch2=ch2-32;什么意思
C语言 错误提示:error C2143: syntax e...
c++编译错误error C2143: syntax err...
c语言问题:error C2143: syntax erro...
求助,为什老提示:\Windows\System32\plp...