niusouti.com

以下代码中变量result的可能类型有哪些?byte b = 11;short s = 13;result = b * ++s;A.byte, short, int, long, float, doubleB.boolean, byte, short, char, int, long, float, doubleC.byte, short, char, int, long, float, doubleD.byte, short, charE.int, long, float, double

题目
以下代码中变量result的可能类型有哪些?byte b = 11;short s = 13;result = b * ++s;

A.byte, short, int, long, float, double

B.boolean, byte, short, char, int, long, float, double

C.byte, short, char, int, long, float, double

D.byte, short, char

E.int, long, float, double


相似考题
更多“以下代码中变量result的可能类型有哪些?byte b = 11;short s = 13;result = b * ++s; ”相关问题
  • 第1题:

    在窗体中使用一个文本框名为n.接受输入的值,有一个命令按钮run,事件代码如下: Private Sub run_Click( ) result = "" For i = 1 To Me!n For j = 1 To Me!n result = result + "*" Next j result = result + Chr(13) + Chr(10) Next i MsgBox result End Sub 打开窗体后,如果通过文本框输入的值为4,单击命令按钮后输出的图型是

    A. * * * * * * * * * * * * * * * *

    B. * * * * * * * * * * * * * * * *

    C. * * * * * * * * * * * * * * * * * * * * * * * * * * * *

    D. * * * * * * * * * * * * * * * *


    正确答案:A

  • 第2题:

    在窗体上有一个名为num2的文本框和run11的命令按钮,事件代码如下: Private Sub run11 Click( ) Select Case num2 Case 0 Result=“0分” Case 60 T0 84 result= “通过” Case IS>=85 result= “优秀” Case Else result=“不合格” End Select MsgBox result End Sub 打开窗体,在文本框中输入80,单击命令按钮,输出结果是( )。

    A.合格

    B.通过

    C.优秀

    D.不合格


    正确答案:B
    输入80时,满足Case60T084条件,因此输出通过。

  • 第3题:

    若有byte b=6;short s=20;则表达式b+s的值的类型是()。

    A.byte

    B.int

    C.short

    D.char


    答案:C

  • 第4题:

    若有float f=2.6f;short s=20;则表达式f+s的值的类型是()。

    A.float

    B.short

    C.int

    D.byte


    答案:A

  • 第5题:

    struct w

    { char low;

    char high;

    };

    union u

    { struct w byte;

    short word;

    }uw;

    main( )

    { int result;

    uw.word=0x1234;

    printf(“word value:%04x\n”,uw.word);

    printf(“high byte:%02x\n”,uw.byte.high);

    printf(“low byte:%02x\n”,uw.byte.low);

    uw.byte.low=0x74;

    printf(“word value:%04x\n”,uw.word);

    result=uw.word+0x2a34;

    printf(“the result:%04x\n”,result);

    }


    正确答案:
    5.word value:1234

  • 第6题:

    Given:   11. String test = "This is a test";   12. String[] tokens = test.split("/s");   13. System.out.println(tokens.length);   What is the result?()

    • A、 An exception is thrown at runtime.
    • B、 1
    • C、 4
    • D、 Compilation fails.
    • E、 0

    正确答案:D

  • 第7题:

    以下代码编译报错的是?()

    • A、double a = 129;
    • B、int a = 129;
    • C、short a = 129;
    • D、byte a = 129;

    正确答案:D

  • 第8题:

    11. String test = “Test A. Test B. Test C.”;  12. // insert code here  13. String[] result = test.split(regex);  Which regular expression inserted at line 12 will correctly split test into “Test A,” “Test B,” and “Test C”?()

    • A、 String regex = “”;
    • B、 String regex = “ “;
    • C、 String regex = “.*“.
    • D、 String regex = “//s”
    • E、 String regex = “//.//s*”;
    • F、 String regex = “//w[ /.] +“;

    正确答案:E

  • 第9题:

    如果定义有short,s;byte,b;char,c,则表达式s*b+c的类型为()

    • A、char
    • B、short
    • C、int
    • D、byte

    正确答案:C

  • 第10题:

    单选题
    如果定义有short,s;byte,b;char,c,则表达式s*b+c的类型为()
    A

    char

    B

    short

    C

    int

    D

    byte


    正确答案: B
    解析: 暂无解析

  • 第11题:

    单选题
    Given: 11.String test = "a1b2c3"; 12.String[] tokens = test.split("//d"); 13.for(String s: tokens) System.out.print(s + " "); What is the result?()
    A

    a b c

    B

    1 2 3

    C

    a1b2c3

    D

    a1 b2 c3


    正确答案: A
    解析: 暂无解析

  • 第12题:

    单选题
    Given: 11.String test = "This is a test"; 12.String[] tokens = test.split("/s"); 13.System.out.println(tokens.length); What is the result?()
    A

    0

    B

    1

    C

    4

    D

    Compilation fails.


    正确答案: A
    解析: 暂无解析

  • 第13题:

    在窗体中使用一个文本框名为num1.接受输入值,有一个命令按钮run13,事件代码如下: Private Sub run13_Click If Me!num1 >= 60 Then result = "及格" ElseIf Me!num1 >= 70 Then result = "通过" ElseIf Me!num1 >= 85 Then result = "合格" End If MsgBox result End Sub 打开窗体后,若通过文本框输入的值为85,单击命令按钮,输出结果是 【13】 。


    正确答案:
    及格

  • 第14题:

    What’s the final result?

    (下面这段代码的最终运行结果是什么)

    double expectedValue = 1/2;

    if(expectedValue > 0)

    {

    expectedValue = expectedValue + 0.5;

    }

    Console.WriteLine(expectedValue);


    正确答案:
     

  • 第15题:

    若有char c='8';short s=20;则表达式c+s的值的类型是()。

    A.char

    B.short

    C.int

    D.byte


    答案:A

  • 第16题:

    以下n变量赋值必须进行强制类型转换的是( )。

    A.int n;n=100+10;

    B.int n;n=100F+10;

    C.int n;short m=10;n=100+m;

    D.int n;short m=10;char s=2;n=s+m;


    正确答案:B

  • 第17题:

    以下代码的输出结果是() while(1) { $var++; $result=$var; if($result==17)break; $var--; } echo($result);

    • A、0
    • B、17
    • C、18
    • D、这是一个无限循环,没有输出

    正确答案:D

  • 第18题:

    Given: 11.String test = "a1b2c3"; 12.String[] tokens = test.split("//d"); 13.for(String s: tokens) System.out.print(s + " "); What is the result?()

    • A、a b c
    • B、1 2 3
    • C、a1b2c3
    • D、a1 b2 c3

    正确答案:A

  • 第19题:

    关于数据类型转换下面描述错误的是()

    • A、byte类型数据可以转换为short、int、long类型数据
    • B、long类型数据有可能转换为byte、short、int类型数据
    • C、在语句int i=(int)78.67;中,变量i的值为79
    • D、当两个数据的类型不同一时,必须先进行数据类型的转换,再运算或赋值

    正确答案:C

  • 第20题:

    Given: 12.Date date = new Date(); 13.df.setLocale(Locale.ITALY); 14.String s = df.format(date); The variable df is an object of type DateFormat that has been initialized in line 11. What is the result if this code is run on December 14, 2000?()

    • A、The value of s is 14-dic-2000.
    • B、The value of s is Dec 14, 2000.
    • C、An exception is thrown at runtime.
    • D、Compilation fails because of an error in line 13.

    正确答案:D

  • 第21题:

    单选题
    Given: 11.String test = "Test A. Test B. Test C."; 12.// insert code here 13.String[] result = test.split(regex); Which regular expression, inserted at line 12,correctly splits test into "Test A","Test B",and "Test C"?()
    A

    String regex = ;

    B

    String regex =  ;

    C

    String regex = .*;

    D

    String regex = //s;

    E

    String regex = //.//s*;


    正确答案: D
    解析: 暂无解析

  • 第22题:

    单选题
    Given: 12.Date date = new Date(); 13.df.setLocale(Locale.ITALY); 14.String s = df.format(date); The variable df is an object of type DateFormat that has been initialized in line 11. What is the result if this code is run on December 14, 2000?()
    A

    The value of s is 14-dic-2000.

    B

    The value of s is Dec 14, 2000.

    C

    An exception is thrown at runtime.

    D

    Compilation fails because of an error in line 13.


    正确答案: C
    解析: 暂无解析

  • 第23题:

    单选题
    12. Date date = new Date();  13. df.setLocale(Locale.ITALY);  14. String s = df.format(date);  The variable df is an object of type DateFormat that has been initialized in line 11. What is the result if this code is run on December 14, 2000?()
    A

     The value of s is 14-dic-2004.

    B

     The value of s is Dec 14, 2000.

    C

     An exception is thrown at runtime.

    D

     Compilation fails because of an error in line 13.


    正确答案: B
    解析: 暂无解析