执行下面的程序段后,b的值为______。a=800b=30a=a+bb=a-ba=a-b
执行下面的程序段后,b的值为______。
a=800
b=30
a=a+b
b=a-b
a=a-b
相关考题:
阅读下面程序,则程序的执行结果为 【10】 。#include "stdio.h"main(){int a=30,b=20,z;z=fun(a+b,a-b);printf("%d\n",z);}fun(int a,int b){int z;z=a/b;return z;}
假如输入为30和60,下列程序运行的结果是【】。 include void main() { int a, b; cin>> 假如输入为30和60,下列程序运行的结果是【 】。include<iostream.h>void main() {int a, b;cin>>a>>b;if(a<b) {a=a+b;b=a-b;a=a-b;}cout<<a<<“,”<<b<<endl}
设a,b,w为整型变量,ch为字符型变量,用if语句改写以下的程序段: switch(ch) { case'+':w=a+b;break; case'-':w=a-b;break; case'*':w=a*b;break; case'/':w=a/b;break;} 在下列写法中,错误的是()A.if(ch= ='+') w=a+b; if(ch= ='-') w=a-b; if(ch= ='*') w=a*b; if(ch= ='/') w=a/b;B.if(ch= ='*') w=a*b; else if(ch= ='/') w=a/b; if(ch= ='+') w=a+b; else if(ch= ='-') w=a-b;C.if(ch= ='+') w=a+b; else if(ch= ='-') w=a-b; if(ch= ='*') w=a*b; else w=a/b;D.if(ch= ='+') w=a+b; elseif(ch= ='-') w=a-b; if(ch= ='*') w=a*b; else if(ch= ='/') w=a/b;