若运行时输入:4.4,则以下程序的运行结果是。#includevoidmain(void){floatcostprice,sellingprice;printf("EnterCostPrice$:");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);}}
举一反三
- 若运行时输入:3 5 /<回车>,则以下程序的运行结果是____。 #inclu...} printf(“%f” ,r); }
- 以下程序的运行结果是 main() {if (2*2==5<2*2==4) printf("T"); else printf("F"); }
- 若运行时输入: 16, 则以下程序的运行结果是 #include void main(void) {intyear; printf("Inputyour year:"); scanf("%d",&year); if(year>=18) printf("your$4.5 yuan/xiaoshi"); else printf("your$3.0 yuan/xiaoshi"); }
- 请阅读以下程序,若运行时输入:1605时,程序的运行结果是 。 main() {...else printf("PM"); }
- 若运行时输入: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"); else printf("2nd class postage is 14p"); 。 ) }