Home / CSE MCQs / C-MCQs :: Data Types

CSE MCQs :: C-MCQs

  1. What is the output of this C code (on a 32-bit machine)?

    int main()
    {
    int x = 10000;
    double y = 56;
    int *p = &x;
    double *q = &y;
    printf("p and q are %d and %d", sizeof(p), sizeof(q));
    return 0;
    }
  2. A.
    p and q are 4 and 4
    B.
    p and q are 4 and 8
    C.
    Compiler error
    D.
    p and q are 2 and 8

  3. Which is correct with respect to size of the datatypes?
  4. A.
    char > int > float
    B.
    int > char > float
    C.
    char < int < double
    D.
    double > char > int

  5. What is the output of the following C code(on a 64 bit machine)?

    union Sti
    {
    int nu;
    char m;
    };
    int main()
    {
    union Sti s;
    printf("%d", sizeof(s));
    return 0;
    }
  6. A.
    8
    B.
    5
    C.
    9
    D.
    4

  7. What is the output of this C code?

    int main()
    {
    float x = 'a';
    printf("%f", x);
    return 0;
    }
  8. A.
    a
    B.
    run time error
    C.
    a.0000000
    D.
    97.000000

  9. Which of the datatypes have size that is variable?
  10. A.
    int
    B.
    struct
    C.
    float
    D.
    double