Sail E0 Webinar

MCQs

Total Questions : 41 | Page 1 of 5 pages
Question 1. The number of digits present after decimal in float is________.
  1.    4
  2.    1
  3.    16
  4.    6
 Discuss Question
Answer: Option D. -> 6


None.


Question 2. What is the size of float in a 32-bit compiler?
  1.    1
  2.    2
  3.    4
  4.    8
 Discuss Question
Answer: Option C. -> 4


None.


Question 3. Loss in precision occurs for typecasting from____________.
  1.    float to double
  2.    char to short
  3.    float to int
  4.    long to float
 Discuss Question
Answer: Option C. -> float to int


None.


Question 4. In a 32-bit compiler, which 2 types have same size?
  1.    char and int
  2.    int and float
  3.    short and int
  4.    float and double
 Discuss Question
Answer: Option B. -> int and float


None.


Question 5. For union    union temp    {        char a;        int b;        float c;    };The size is decided by:
  1.    char
  2.    int
  3.    float
  4.    Both (b) and (c)
 Discuss Question
Answer: Option D. -> Both (b) and (c)


None.


Question 6. What is the output of this C code? (7 and 8 are entered)    void main()    {        float x;        int y;        printf("enter two numbers \n", x);        scanf("%f %f", &x, &y);        printf("%f, %d", x, y);    }
  1.    7.000000, 7
  2.    Run time error
  3.    7.000000, Junk
  4.    Varies
 Discuss Question
Answer: Option C. -> 7.000000, Junk


None.


Question 7. What is the output of this C code?    int main()    {        unsigned int i = 23;        signed char c = -23;        if (i > c)            printf("Yes\n");        else if (i < c)            printf("No\n");    }
  1.    Yes
  2.    No
  3.    Depends on the compiler
  4.    Depends on the operating system
 Discuss Question
Answer: Option B. -> No


None.


Question 8. When double is converted to float, the value is?
  1.    Truncated
  2.    Rounded
  3.    Depends on the compiler
  4.    Depends on the standard
 Discuss Question
Answer: Option C. -> Depends on the compiler


None.


Question 9.

What is the output of this C code?    void main()    {        double x = 123828749.66;        int y = x;        printf("%d\n", y);        printf("%lf\n", y);    }

  1.    0, 0.0
  2.    123828749, 123828749.66
  3.    12382874, 12382874.0
  4.    123828749, 0.000000
 Discuss Question
Answer: Option D. -> 123828749, 0.000000


None.


Question 10.

What is the output of this C code?    void main()    {        int x = 97;        char y = x;        printf("%c\n", y);    }

  1.    a
  2.    b
  3.    97
  4.    Run time error
 Discuss Question
Answer: Option A. -> a


None.


Latest Videos

Latest Test Papers