正在加载图片...
·14 C语言程序设计上机指导与同步训练 printf("Enter Cost Price $ " scanf(“f”,& Costprice); if (CostPrice>=5) printf("Selling Price(0.25)$6.2f", SellingPrice) e⊥se SellingPrice=CostPrice+CostPrice*0. 30: printf("Selling Price(0.30)$962f", SellingPrice) 3.以下程序的运行结果是 if(2*2==5<2*2==4) print("T”); else 能力提高(B) 选择题 1.若希望当A的值为奇数时,表达式的值为“真”,A的值为偶数时,表达式的值为 “假”,则以下不能满足要求的表达式是() 2.下列运算符中优先级最低的(),优先级最高的是()。 A)? 3.请阅读以下程序 inta=5,b=0,C=0; if(a=b+c) printf(”**n”) printf("$$sn”) 以下程序()。 ∧)有语法错不能通过编译B)可以通过编译但不能通过连接 C)输出** D)输出$ss 4.以下程序的运行结果是() printf("dln”,m);·140· C 语言程序设计上机指导与同步训练 ·140· printf(“Enter Cost Price $:”); scanf(“%f”,&CostPrice); if(CostPrice>=5) { SellingPrice=CostPrice+CostPrice*0.25; printf(“Selling Price(0.25)$%6.2f”,SellingPrice); } else { SellingPrice=CostPrice+CostPrice*0.30; printf(“Selling Price(0.30)$%6.2f”,SellingPrice); } } 3. 以下程序的运行结果是 。 main() { if(2*2==5<2*2==4) print(“T”); else printf(“F”); } 能力提高(B) 一、选择题 1. 若希望当 A 的值为奇数时,表达式的值为“真”,A 的值为偶数时,表达式的值为 “假”,则以下不能满足要求的表达式是( )。 A) A%2==1 B) !(A%2==0) C) !(A%2) D) A%2 2. 下列运算符中优先级最低的( ),优先级最高的是( )。 A)?: B)&& C)+ D)!= 3. 请阅读以下程序 main() { int a=5,b=0,c=0; if(a=b+c) printf(“***\n”); else printf(“$$$\n”); } 以下程序( )。 A) 有语法错不能通过编译 B) 可以通过编译但不能通过连接 C) 输出*** D) 输出$$$ 4. 以下程序的运行结果是( )。 main() { int m=5; if(m++>5) printf(“%d\n”,m);
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有