Test Your C Skills

10 Questions  I  By Pranay573
Please take the quiz to rate it.

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.

  
Changes are done, please start the quiz.


Questions and Answers

Removing question excerpt is a premium feature

Upgrade and get a lot more done!
  • 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. 
    Predict the output of the following program #include<stdio.h> void main() { static char *s[ ]={"black","white","pink","violet"}; char **ptr[ ]={s+3,s+2,s+1,s}, ***p; p=ptr; ++p; printf("%s", **p+1); }  
    • 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


Back to top

Removing ad is a premium feature

Upgrade and get a lot more done!
Take Another Quiz
We have sent an email with your new password.