Skill Test

12 Questions | Attempts: 170
Please wait...
Question 1 / 13
🏆 Rank #--
Score 0/100

1.  Which is correct with respect to size of the datatypes?

Explanation

char has lesser bytes than int and int has lesser bytes than double in any system

Submit
Please wait...
About This Quiz
Skill Assessment Quizzes & Trivia

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

2.

What first name or nickname would you like us to use?

You may optionally provide this to label your report, leaderboard, or certificate.

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.     }

Explanation

In enum, the value of constant is defined to the recent assignment from left.

Submit

3. 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.     }

Explanation

Cannot change a const type value.

Submit

4. 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.     }

Submit

5. 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.     }

Explanation

There can be blocks inside block and within blocks variables have only block scope.

Submit

6. 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.     }

Submit

7. 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.     }

Explanation

Variable j is not defined.

Submit

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.     }

Submit

9.
  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.     }

Explanation

010 is octal representation of 8.

Submit

10.  Which of the following declaration is not supported by C?

Explanation

It is legal in Java, not in C.

Submit

11. 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.     }

Submit

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.     }

Submit
×
Saved
Thank you for your feedback!
View My Results
Cancel
  • All
    All (12)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
 Which is correct with respect to size of the datatypes?
What is the output of this C code? ...
What is the output of this C code? ...
What is the output of this C code? ...
Does this compile without error? ...
What is the output of this C code? ...
What is the output of this C code? ...
 What is the output of this C code? ...
What is the output of this C code? ...
 Which of the following declaration is not supported by C?
What is the output of this C code? ...
What is the output of this C code? #include int main() { ...
play-Mute sad happy unanswered_answer up-hover down-hover success oval cancel Check box square blue
Alert!