C语言作业第4章 分支结构程序设计作业

概1
#include<stdio.h>int main(){ int m = 23, n = 5; printf("%d\n",!m + m % n); return 0;}

概6
#include<stdio.h>int main(){ int x = 1, y = 2; (x > y) && (–x > 0); printf("%d\n",x); return 0;}

概15代码
#include<stdio.h>int main(){ int a = 0, b = 3, c = 2; if (a++ && b++) { c–; } else if (a + 1 == 6 || b–) { c++; } printf("%d,%d,%d\n", a, b, c); return 0;}

概16代码
#include<stdio.h>#include<math.h>int main(){ int a=2 , b=2 ,c=4; if (sqrt(fabs(a)) != (4 * a) / (b * c)) { a = 2; } else { printf(“不构成”); } printf("%d\n", a); return 0;}

概17
#include<stdio.h>int main(){ int a = 0, b = 0, c = 0; if(a++&&(b+=a)||++c) printf("%d,%d,%d\n",a,b,c); return 0;}

选择题8
#include<stdio.h>int main(){ int a, b, x, y; x = 3, y = 5; if (x > y) { a = x; b = y; } else { a = y; b = x; } printf("%d,%d\n", a, b); return 0;}

选择题10
#include<stdio.h>int main(){ int a , b , c ; a = 3; b = 3; c = 2; printf("%d,\n",!a&&!b&&c); return 0;}

选择题17
#include<stdio.h>int main(){ int n; n = 8; n %= (n - 2); printf("%d\n",n); return 0;}

选择题18
#include<stdio.h>int main(){ int a = 3, b = 2,x; x = a > b++?a++:b++; printf("%d,%d,%d\n",x,a,b); return 0;}

选择题20
#include<stdio.h>int main(){ int x, y, z; x = 4; y = 3; z = 5; if (x > y) { z = x; x = y; y = z; } printf("%d,%d,%d\n",x,y,z); return 0;} 选择题24#include<stdio.h>int main(){ int a = 0, b = 2; b = --a || ++b; printf("%d\n",b); return 0;}选择题25#include<stdio.h>int main(){ int s, x; x = 5; s = x <= 0 ? -1 : (x == 0) ? 0 : 1; printf(“s=%d\n”,s); return 0;}阅读1#include<stdio.h>int main(){ int x = 0, y = 1, z = 10; if (x) { if (y) { z = 20; } else { z = 30; } } printf("%d\n",z); return 0;}阅读3#include<stdio.h>int main(){ int x

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值