问题详情

以下选项中,正确的if-else语句是( )


A、if(x!=0) printf("%d",x) else printf("%d",-x);

B、if(x!=0) { x=x+y;printf("%d",x);} else printf("%d",-x);

C、if(x!=0) x=x+y;printf("%d",x); else printf("%d",-x);

D、if(x!=0) { x=x+y;printf("%d",x)}; else printf("%d",-x);

时间:2022-01-11 06:48 关键词:

答案解析

B