网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)
单选题
表达式:(int)((double)9/2)-9%2的值是(  )。
A

0

B

3

C

4

D

5


参考答案

参考解析
解析:
运算符“/”、“%”的优先级高于“-”,所以先进行除法和求余运算,再进行减法运算。强制类型转换表达式的形式:(类型名)(表达式)。“9/2”结果为4,转换成double类型再转换成int类型结果依然为4,9%2的结果为1,最后结果为4-1=3。答案选择B选项。
更多 “单选题表达式:(int)((double)9/2)-9%2的值是(  )。A 0B 3C 4D 5” 相关考题
考题 (6)表达式(int)((double)(5/2)+2.5)的值是【6】

考题 表达式 (int)((double)(5/2)+2.5) 的值是【 6 】

考题 国家二级C语言真题 表达式(int)((double)9/2)-(9)%2的值是A0B3C4D5

考题 设有如下变量定义: double a=3.500000;float b=2.5; int m=2,n=3; 则表达式“(float)(m+n)/2+(int)a%(int)b”的值是( )A.2.5B.3.5C.4.5D.表达式不正确

考题 表达式:(int)((double)9/2)-(9)%2的值是( )。A.0B.3C.4D.5

考题 表达式:(int)((double)9/2)-(9)%2.的值是A.0B.3C.4D.5

考题 若有定义:int a=6,b=2;charc1=’a’,c2=’b’;则表达式a+b%5+c2-c1的值是() A.7B.8C.9D.表达式错误

考题 若有定义:int a,b;则表达式(a=2,b=5,a*2,b++,a+b)的值是() A.7B.8C.9D.10

考题 若有定义:int i,j;则表达式(i=2,j=5,i++,i+j++)的值是() A.7B.8C.9D.10

考题 表达式:(im)((double)9/2)一9%2的值是( )。A.0B.3C.4D.5

考题 有如下说明: int a[10]={1,2,3,4,5,6,7,8,9,10},* P=a; 则数值为9的表达式是( )。 A.*P+9SXB 有如下说明: int a[10]={1,2,3,4,5,6,7,8,9,10},* P=a; 则数值为9的表达式是( )。A.*P+9B.木(P+8)C.*P+=9D.P+8

考题 下列表达式的值为4的有哪几项。() A、2*9-14B、abs(-2)*2C、Sqr(9)+1D、Int( 2.9)*2

考题 如果a=5,b=2,c=3,d=4,则表达式ab?a:cd?c:d的值是()。A、2B、3C、4D、5

考题 表达式(double)(20/3)的值为()A、2B、3C、6D、6.0

考题 表达式5 Mod3+5/3的值是()A、0B、3C、4D、6

考题 若有定义:int a=6,b=2;charc1=’a’,c2=’b’;则表达式a+b%5+c2-c1的值是()A、7B、8C、9D、表达式错误

考题 若有定义:int a,b;则表达式(a=2,b=5,a*2,b++,a+b)的值是()A、7B、8C、9D、10

考题 表达式12/4-2+5*8、4%5/2的值为()。A、1B、3C、4D、10

考题 a[][3]={1,2,3,4,5,6,7,8,9};则a数组第一维的大小是().A、2B、3C、4D、无确定值

考题 表达式(int)((double)9/2)-(9)%2的值是()A、0B、3C、4D、5

考题 表达式6.5*5Mod 28/8的值是()。A、0B、3C、2D、1

考题 int[][] myArray3=new int[3][]{newint[3]{5,6,2},new int[5]{6,9,7,8,3},new int[2]{3,2}};myArray3[2][2]的值是()。A、9B、2C、6D、越界

考题 int a_really_really_really_long_variable_name=5;   int _hi=6;   int big=Integer.getInteger(“7”);   int $dollars=8;   int %percent=9;   有几个可以通过编译?()  A、2B、3C、4D、5E、1

考题 单选题若有定义:int a,b;则表达式(a=2,b=5,a*2,b++,a+b)的值是()A 7B 8C 9D 10

考题 单选题int[][] myArray3=new int[3][]{newint[3]{5,6,2},new int[5]{6,9,7,8,3},new int[2]{3,2}};myArray3[2][2]的值是()。A 9B 2C 6D 越界

考题 单选题若有定义:int i,j;则表达式(i=2,j=5,i++,i+j++)的值是()A 7B 8C 9D 10

考题 单选题表达式:(int)((double)9/2)-9%2的值是(  )。A 4B 0C 3D 5

考题 单选题若有定义:int a=6,b=2;charc1=’a’,c2=’b’;则表达式a+b%5+c2-c1的值是()A 7B 8C 9D 表达式错误