题目内容

若有定义:float x=1.5;

A. switch(a+b){ case 1: printf("*\n");case 2+1: printf("**\n"); }
B. switch((int)x);{ case 1: printf("*\n");case 2: printf("**\n"); }
C. switch(x){ case 1.0: printf("*\n");case 2.0: printf("**\n"); }
D. switch(a+b){ case 1: printf("*\n");case c: printf("**\n"); }

查看答案
更多问题

有以下程序

A. 2
B. 0
C. 1
D. 3

若运行时输入:16,则以下程序的运行结果是#include void main(void){intyear;printf("Inputyour year:");scanf("%d",&year);if(year>=18)printf("your$4.5 yuan/xiaoshi");elseprintf("your$3.0 yuan/xiaoshi"); }

若运行时输入: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);}}

答案查题题库