更多“若有以下定义:chara:intb;floatc;doubled;则表达式a*b+d c的值的类型为 ______。A.floatB.intC.ch ”相关问题
  • 第1题:

    若有以下定义;char a;int b; float c;double d;则表达式“a*b+d-c”值的类型为( )

    A.float

    B.int

    C.char

    D.double


    正确答案:D

  • 第2题:

    15、若有以下定义,则表达式“a * b + d – c”的值的类型为 #include <stdio.h> int main() { char a; int b; float c; double d; .... return 0; }

    A.double

    B.int

    C.float

    D.char


    C

  • 第3题:

    若有以下定义,则表达式“a * b + d – c”的值的类型为 #include <stdio.h> int main() { char a; int b; float c; double d; .... return 0; }

    A.double

    B.int

    C.float

    D.char


    C

  • 第4题:

    若有以下定义:char a;int b;float c;double d;则表达式a*b+d-c值的类型为( )。A.A. float SXB

    若有以下定义:

    char a;int b;

    float c;double d;

    则表达式a*b+d-c值的类型为( )。

    A.A. float

    B.int

    C.char

    D.double


    正确答案:D
    在表达式a*b+d-c中,double的类型最高,C语言中,由低类型自动向高类型转换,所以最后的结果一定是double型。

  • 第5题:

    若有以下定义,则表达式“a * b + d – c”的值的类型为 #include <stdio.h> int main() { char a; int b; float c; double d; .... return 0; }

    A.double

    B.int

    C.float

    D.char


    D

  • 第6题:

    8、若有以下定义,则表达式“a * b + d – c”的值的类型为 #include <stdio.h> int main() { char a; int b; float c; double d; .... return 0; }

    A.double

    B.int

    C.float

    D.char


    D 解析:a、b、c为整型,赋值运算符两侧的数据类型不一致,系统先自动将右侧表达式求得的数值,按赋值号左边变量的类型进行转换,再赋值给左边的变量。去掉右侧表达式值的小数部分变为整数赋值给变量c,c的值为2。