下面哪个表达式是错误的( )
A: int i = 100;
B: float f = 100.0;
C: Object o = “Hello world”;
D: char c = ‘ሴ’;
A: int i = 100;
B: float f = 100.0;
C: Object o = “Hello world”;
D: char c = ‘ሴ’;
举一反三
- 下面哪个表达式是错误的( ) A: int i = 100; B: float f = 100.0; C: Object o = “Hello world”; D: char c = ‘\u1234’;
- 以下共用体定义错误的是() A: union{ int i;char ch;float f;}a,b,c; B: union data{int i;char ch;float f;} C: union data{int i; char ch;float f;}union data a,b,c; D: union data{ int i;char ch;float f;};union dataa,b,c;
- 设变量f为float型,将f小数点后第3位四舍五入,保留小数点后两位的表达式为( )。 A: ( f * 100+0.5)/100 B: (f * 100+0.5)/100.0 C: (int)( f * 100+0.5)/100.0 D: (int)( f * 100+0.5)/100
- 下面哪个是非法的() A: int I = 32; B: float f = 45.0; C: double d = 45.0; D: char c = ‘u’;
- 下面错误的初始化语句是_____ A: char str[]="hello"; B: char str[]={'hello'}; C: char str[100]="hello"; D: char str[]={'h','e','l','l','o'};