Home / C Programming / Declarations and Initializations :: MCQ Set 1

C Programming :: Declarations and Initializations

  1. Which of the following statements should be used to obtain a remainder after dividing 3.14 by 2.1 ?

  2. A.

    rem = 3.14 % 2.1;

    B.

    rem = modf(3.14, 2.1);

    C.

    rem = fmod(3.14, 2.1);

    D.

    Remainder cannot be obtain in floating point division.

    View Answer

    Workspace

    Discuss Discuss in Forum


  3. What will be the output of the following program?

    #include<stdio.h> int main() {     extern int i;     i = 20;     printf("%ld ", sizeof(i));     return 0; }
  4. A.

    2

    B.

    4

    C.

    Depends on the Compiler

    D.

    Linker Error : Undefined symbol 'i'

    View Answer

    Workspace

    Discuss Discuss in Forum