Skill Test

12 Questions | Attempts: 170
Share

SettingsSettingsSettings
Skill Assessment Quizzes & Trivia

Skill Test is a unique platform to assess your skills and showcase your expertise.


Questions and Answers
  • 1. 

     Which is correct with respect to size of the datatypes?

    • A.

      Char > int > float

    • B.

      int > char > float

    • C.

      char < int < double

    • D.

      Double > char > int

    Correct Answer
    C. char < int < double
    Explanation
    char has lesser bytes than int and int has lesser bytes than double in any system

    Rate this question:

  • 2. 

    What is the output of this C code?
    1. #include
    2. int main()
    3. {
    4. enum {ORANGE = 5, MANGO, BANANA = 4, PEACH};
    5. printf("PEACH = %d\n", PEACH);
    6. }

    • A.

      PEACH = 3

    • B.

      PEACH = 4

    • C.

      PEACH = 5

    • D.

      PEACH = 6

    Correct Answer
    C. PEACH = 5
    Explanation
    In enum, the value of constant is defined to the recent assignment from left.

    Rate this question:

  • 3. 

    1. What is the output of this C code? #include <stdio.h>
    2. int main()
    3. {
    4. int var = 010;
    5. printf("%d", var);
    6. }

    • A.

      2

    • B.

      8

    • C.

      10

    • D.

      9

    Correct Answer
    B. 8
    Explanation
    010 is octal representation of 8.

    Rate this question:

  • 4. 

    What is the output of this C code?
    1. #include
    2. void foo(const int *);
    3. int main()
    4. {
    5. const int i = 10;
    6. printf("%d ", i);
    7. foo(&i);
    8. printf("%d", i);
    9.  
    10. }
    11. void foo(const int *i)
    12. {
    13. *i = 20;
    14. }

    • A.

      Compile time error

    • B.

      10 20

    • C.

      Undefined value

    • D.

      10

    Correct Answer
    A. Compile time error
    Explanation
    Cannot change a const type value.

    Rate this question:

  • 5. 

    What is the output of this C code?
    1. #include <stdio.h>
    2. int main()
    3. {
    4. j = 10;
    5. printf("%d\n", j++);
    6. return 0;
    7. }

    • A.

      10

    • B.

      11

    • C.

      Compile time error

    • D.

      0

    Correct Answer
    C. Compile time error
    Explanation
    Variable j is not defined.

    Rate this question:

  • 6. 

    Does this compile without error?
    1. #include <stdio.h>
    2. int main()
    3. {
    4. int k;
    5. {
    6. int k;
    7. for (k = 0; k < 10; k++);
    8. }
    9. }

    • A.

      Yes

    • B.

      No

    • C.

      Depends on the compiler

    • D.

      Depends on the C standard implemented by compilers

    Correct Answer
    A. Yes
    Explanation
    There can be blocks inside block and within blocks variables have only block scope.

    Rate this question:

  • 7. 

     Which of the following declaration is not supported by C?

    • A.

      String str;

    • B.

      Char *str;

    • C.

      float str = 3e2;

    • D.

      Both (a) and (c)

    Correct Answer
    A. String str;
    Explanation
    It is legal in Java, not in C.

    Rate this question:

  • 8. 

     What is the output of this C code?
    1. #include <stdio.h>
    2. void main()
    3. {
    4. int x = 97;
    5. char y = x;
    6. printf("%c\n", y);
    7. }

    • A.

      A

    • B.

      B

    • C.

      97

    • D.

      Run time error

    Correct Answer
    A. A
  • 9. 

    What is the output of this C code?
    1. #include <stdio.h>
    2. int main()
    3. {
    4. int a = 1, b = 1, d = 1;
    5. printf("%d, %d, %d", ++a + ++a+a++, a++ + ++b, ++d + d++ + a++);
    6. }

    • A.

      9, 6, 9

    • B.

      15, 4, 5

    • C.

      9, 3, 5

    • D.

      6, 4, 6

    Correct Answer
    B. 15, 4, 5
  • 10. 

    What is the output of this C code?
    1. #include <stdio.h>
    2. void main()
    3. {
    4. int x = 0;
    5. if (x = 0)
    6. printf("Its zero\n");
    7. else
    8. printf("Its not zero\n");
    9. }

    • A.

      Its zero

    • B.

      Run time error

    • C.

      Its not zero

    • D.

      None

    Correct Answer
    C. Its not zero
  • 11. 

    What is the output of this C code?
    1. #include <stdio.h>
    2. void main()
    3. {
    4. int k;
    5. for (k = -3; k < -5; k++)
    6. printf("Hello");
    7. }

    • A.

      Run time error

    • B.

      Infinite hello

    • C.

      Nothing

    • D.

      Hello

    Correct Answer
    C. Nothing
  • 12. 

    What is the output of this C code?
    1. #include
    2. int main()
    3. {
    4. int x = 0;
    5. if (x++)
    6. printf("true\n");
    7. else if (x == 1)
    8. printf("false\n");
    9. }

    • A.

      Undefined behaviour

    • B.

      Compile time error

    • C.

      False

    • D.

      True

    Correct Answer
    B. Compile time error

Quiz Review Timeline +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Aug 24, 2017
    Quiz Edited by
    ProProfs Editorial Team
  • Aug 25, 2013
    Quiz Created by
    Prabhaforritari
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.