TEST YOUR C SKILLS

10 Questions
C Programming Quizzes & Trivia

Welcome to test your c skills online quiz. This consists of 10 questions about c-language you have to answer in 7min.

Please wait...
Questions and Answers
  • 1. 
    #include<stdio.h> void main() { struct emp { char name[20]; int age; float sal; }; struct emp e={"Tiger"}; printf("\n %d %f",e.age,e.sal); }  
    • A. 

      0 0.000000

    • B. 

      Garbage values

    • C. 

      Error

    • D. 

      None of the above

  • 2. 
    Which of the following set of statements is correct?
    • A. 

      Typedef long a; extern int a c;

    • B. 

      Typedef long a; extern a int c:

    • C. 

      Typedef long a; extern a c;

  • 3. 
    By default a real number is treated as
    • A. 

      Float

    • B. 

      Double

    • C. 

      Long double

    • D. 

      Depends on the memory model you are using

  • 4. 
    How many times the following program will print "Jamboree"? #include<stdio.h> void main() { printf("\n Jamboree"); main(); }
    • A. 

      Infinite number of times

    • B. 

      32767 times

    • C. 

      65535 times

    • D. 

      Till the stact doesn't overflow

  • 5. 
    Is it true that too many recursive calls may result into stact overflow?
    • A. 

      True

    • B. 

      False

  • 6. 
    Predict the output of the following program #include<stdio.h> #define SQR(x) (x*x) void main() { int a,b=3; a=SQR(b+2); printf("\n %d",a); }
    • A. 

      25

    • B. 

      11

    • C. 

      Error

    • D. 

      Garbage value

  • 7. 
    • A. 

      Ink

    • B. 

      Ack

    • C. 

      Ite

    • D. 

      Let

  • 8. 
    Predict the output of the following program #include<stdio.h> #include<string.h> void main() { char str[ ]="sales\0\man\0"; printf("%s",str); }  
    • A. 

      Man

    • B. 

      Sales

    • C. 

      Sales man

    • D. 

      Sales\0man

  • 9. 
    The library function used to reverse the string is
    • A. 

      Strstr( )

    • B. 

      Strrev( )

    • C. 

      Revstr( )

    • D. 

      None of the above

  • 10. 
    Malloc( ) allocates memory from the heap and not from the stack
    • A. 

      True

    • B. 

      False