Sail E0 Webinar

MCQs

Total Questions : 41 | Page 4 of 5 pages
Question 31. Which data type is suitable for storing a number like?      10.0000000001
  1.    int
  2.    float
  3.    double
  4.    Both (b) and (c)
 Discuss Question
Answer: Option C. -> double


None.


Question 32. %f access specifier is used for?
  1.    Integer type
  2.    Character type
  3.    Floating type
  4.    None of the above
 Discuss Question
Answer: Option C. -> Floating type


None.


Question 33. What is the output of this C code?    int main()    {        float a = 5.477777777777;        printf("%f", a);    }
  1.    5.477777
  2.    5.477778
  3.    5.478
  4.    5.48
 Discuss Question
Answer: Option A. -> 5.477777


None.


Question 34. Select the odd one out with respect to type?
  1.    char
  2.    int
  3.    long
  4.    float
 Discuss Question
Answer: Option D. -> float


None.


Question 35. Which of the following % operation is invalid?
  1.    4 % 8;
  2.    4 % 8l;
  3.    4 % 8f;
  4.    Both (b) and (c)
 Discuss Question
Answer: Option C. -> 4 % 8f;


None.


Question 36. Modulus for float could be achieved by?
  1.    fmod(a, b);
  2.    modulus(a, b);
  3.    a % b
  4.    mod(a, b);
 Discuss Question
Answer: Option A. -> fmod(a, b);


None.


Question 37. %lf is used to display?
  1.    float
  2.    long float
  3.    double
  4.    int
 Discuss Question
Answer: Option C. -> double


None.


Question 38.

What is the output of this C code?    void main()    {        float x = 0.1;        if (x == 0.1)            printf("Sanfoundry");        else            printf("Advanced C Classes");    }

  1.    Advanced C Classes
  2.    Sanfoundry
  3.    Run time error
  4.    Compile time error
 Discuss Question
Answer: Option A. -> Advanced C Classes


None.


Question 39. Comment on the output of this C code?    void main()    {        float x = 0.1;        printf("%d, ", x);        printf("%f", x);    }
  1.    0.100000, junk value
  2.    junk value, 0.100000
  3.    0, 0.100000
  4.    0, 0.999999
 Discuss Question
Answer: Option B. -> junk value, 0.100000


None.


Question 40. Predict the data type of the following mathematical operation?     12 * 7 + 5 / 2 . 0
  1.    int
  2.    long
  3.    float
  4.    double
 Discuss Question
Answer: Option D. -> double


None.


Latest Videos

Latest Test Papers