若运行时输入:2,则以下程序的运行结果是#include void main(void){char class;printf("Enter 1 for 1st class post or 2 for 2nd post");scanf("%c",&class);if (class=='1')printf("1st class postage is 19p");elseprintf("2nd class postage is 14p"); 。 )}
查看答案
若运行时输入:4.4,则以下程序的运行结果是。#includevoidmain(void){floatcostprice,sellingprice;printf("EnterCost Price $:");scanf("%f",&costprice);if(costprice>=5){sellingprice=costprice+costprice*0.25;printf("SellingPrice(0.25)$%6.2f",sellingprice);}else{sellingprice=costprice+costprice*0.30;printf("SellingPrice(0.30)$%6.2f",sellingprice);}}
以下程序的运行结果是main(){if (2*2==5<2*2==4)printf("T");elseprintf("F");}
请阅读以下程序,若运行时输入:1605时,程序的运行结果是。main(){intt,h,m;scanf("%d",&t);h=t/100%12;if(h==0)h=12;printf("%d:",h);m=t%100;if(m<10)printf("0");printf("%d",m);if(t<1200||t==2400)printf("AM");elseprintf("PM");}
以下程序实现:输入园的半径r和运算标志m,按照运算标志进行指定计算,请填空。标志运算a面积c周长b二者均计算#definepi=3.14159main(){charm;floatr,c,a;printf("Inputmark a c or b && r\n");scanf("%c%f",&m,&r);if( {a=pi*r*r;printf("area is %f",a);}if( {c=2*pi*r;printf("circle is %f",c);}if( {a=pi*r*r;c=2*pi*r;printf("area&& circle are %f %f",a,c);}}