C Programming Hardest Trivia Questions Test! Quiz

37 Questions

Settings
Please wait...
C Programming Hardest Trivia Questions Test! Quiz

This quiz is the C Programming Hardest Trivia Questions Test that programming students should have a try and tackle before they sit for their certification exams. Do you feel like you have what it takes to tackle it based on what you have learnt so far? How about you give it a try and see how well you will do?


Questions and Answers
  • 1. 
    What statement can print \n on screen?
    • A. 

      Printf("\\n");

    • B. 

      Printf("n\")

    • C. 

      Printf('\\n')

    • D. 

      Printf("\n")

  • 2. 
    Address stored in the pointer variable is of type?
    • A. 

      Int

    • B. 

      Float 

    • C. 

      Array

    • D. 

      String

  • 3. 
    What is the output of the following code
    • A. 

      11 11 11

    • B. 

      Compile time error

    • C. 

      Segmentation  fault/code trash

    • D. 

      12 12 undefined value

  • 4. 
    What will be printed? int a = 15;  int b = 0;  b = (a % 7);    printf("\n\n%i\n", b);
    • A. 

      0

    • B. 

      1

    • C. 

      7

    • D. 

      15

  • 5. 
    Which header file should be included to use functions like malloc() and calloc()?
    • A. 

      Dos.h

    • B. 

      Alloc.h

    • C. 

      Stdlib.h

    • D. 

      Memory.h

  • 6. 
    The operators . , !! , < , = if arranged in ascending order of precedence reads?
    • A. 

      .,!!,<,=

    • B. 

      =,<,!!,.

    • C. 

      =,!!,<,.

    • D. 

      <,!!,=,.

  • 7. 
    How many tokens are there in the following?       if(csi==100);
    • A. 

      6

    • B. 

      7

    • C. 

      5

    • D. 

      4

  • 8. 
    Which one of the four equations will be correct? given interchanges: signs "-" and "*" , numbers 3 and 6. 
    • A. 

      6-3*2=9

    • B. 

      6*3-4=15

    • C. 

      3-6*8=10

    • D. 

      3*6-4=33

  • 9. 
     What is the output of this C code?   void main() {     int i, j;     for(i=0,j=0;i<10,j<20;i++,j++){         printf("i=%d \t j=%d\n", i, j);     } }
    • A. 

      Print i and j till 19

    • B. 

      Print i till 9 and j till 19

    • C. 

      Print i and j till 9

    • D. 

      Runtime error

  • 10. 
    What gets printed? printf("%d\n",4 ?:8);
    • A. 

      8

    • B. 

      4

    • C. 

      Null

    • D. 

      Compiler error

  • 11. 
    What is the output of this C code? #include int main() {     int y = 2;     int z = y +(y = 10);     printf("%d\n", z); }
    • A. 

      2

    • B. 

      4

    • C. 

      20

    • D. 

      Compile time error

  • 12. 
    C programming:the given expression P-=Q+1 is same as
    • A. 

      P=P-Q-1

    • B. 

      P=P-Q+1

    • C. 

      P=-P+Q+1

    • D. 

      NONE

  • 13. 
    Which keyword is used for coming out of recursion?
    • A. 

      Break 

    • B. 

      Return

    • C. 

      Exit

    • D. 

      All the above

    • E. 

      Continue

  • 14. 
    Which of the following does not represent a valid storage class in C?
    • A. 

      Static

    • B. 

      Union

    • C. 

      Extern

    • D. 

      Automatic

  • 15. 
    How many times is Hello world printed ?   int main() {     fork();     fork();     printf("Hello world\n"); }
    • A. 

      1

    • B. 

      2

    • C. 

      4

    • D. 

      8

  • 16. 
    Which of the following cannot be static in C?
    • A. 

      Variables 

    • B. 

      Structures

    • C. 

      Functions

    • D. 

      None

  • 17. 
    According to ANSI specifications which is the correct way of declaring main when it receives command-line arguments?
    • A. 

      Int main(int argc,char *argv[])

    • B. 

      Int main(){int argc ; char *argv);

    • C. 

      None

    • D. 

      Int main {argc,argv)int argc; char *argv;

  • 18. 
    Char *s[10] defines an array of ___________
    • A. 

      None

    • B. 

      String to pointer 

    • C. 

      Pointers to strings

    • D. 

      Both pointers to string and strings to pointers

  • 19. 
    Which of the following is not a standard C Library?
    • A. 

      Errno.h

    • B. 

      Setjmp.h

    • C. 

      Signal.h

    • D. 

      Retarg.h

  • 20. 
    A pointer in a C which has not been initialized is know as
    • A. 

      Far pointer

    • B. 

      Void pointer

    • C. 

      Null pointer

    • D. 

      Wild pointer

  • 21. 
    What is the output of the following 
    • A. 

      Yes 

    • B. 

      No

    • C. 

      Compile time error

    • D. 

      Yes no

  • 22. 
    What will be x in the following c code? #include void main() {  int x; }
    • A. 

      Automatic variable

    • B. 

      Static variable

    • C. 

      Registered variable

    • D. 

      Global variable

  • 23. 
    How will you free the allocated memory?
    • A. 

      Delete(var-name);

    • B. 

      Free(var-name);

    • C. 

      Remove(var-name)

    • D. 

      Dealloc(var-name);

  • 24. 
    What is the output of the following?   #include int main() {     char ch;     if(ch = printf(""))         printf("It matters\n");     else         printf("It doesn't matters\n");     return 0; }
    • A. 

       It matters

    • B. 

      It doesn’t matters

    • C. 

       Run time error

    • D. 

      Nothing

  • 25. 
    When fopen() is not able to open a file, then it returns
    • A. 

      Compiler dependent

    • B. 

      Runtime error

    • C. 

      EOF

    • D. 

      NULL

  • 26. 
    A B C D E F G H I J K L M N O P Q R S T U V W X Y Z Which letter should be 9th letter to the left of 9th letter from the right if the first half of the given alphabets is reversed
    • A. 

    • B. 

      E

    • C. 

      F

    • D. 

      I

  • 27. 
    Odd man out.
    • A. 

      Billiards

    • B. 

      Basketball

    • C. 

      Snookers

    • D. 

      Table tennis

  • 28. 
    Umbrella is to rain what goggles are to?
    • A. 

      Light 

    • B. 

      Glare

    • C. 

      Sun

    • D. 

      Beam

  • 29. 
    In a row of 10 boys, when Rohith was shifted by 2 places towards the left he became 7th from the left end what was his earlier position from the right end of the row?
    • A. 

      1

    • B. 

      2

    • C. 

      4

    • D. 

      6

  • 30. 
    4,23,60,121,___?
  • 31. 
    Pain:Misery::?
    • A. 

      Ignore::greet

    • B. 

      Ignorance::confusion

    • C. 

      Disease:poverty

    • D. 

      Despair:lonliness

  • 32. 
    1   11   21   1211 111221   ________
    • A. 

      213211

    • B. 

      312211

    • C. 

      122311

    • D. 

      312221

  • 33. 
    Which one of the following is not a prime number?
    • A. 

      31

    • B. 

      61

    • C. 

      71

    • D. 

      91

  • 34. 
    Number of letters skipped in between adjacent letters in the series is in the order of 12 ,22,32 . which of the following series observes the above rule
    • A. 

      CEJT

    • B. 

      EGLO

    • C. 

      EGLP

    • D. 

      RTWZ

  • 35. 
    A clock is so placed that at 12 noon its minutes hand points towards north-east, in which direction does its hour hand points at 1.30p.m?  
    • A. 

      North

    • B. 

      West

    • C. 

      South 

    • D. 

      East

  • 36. 
    If one-third of one-fourth of a number is 15, then three-tenth of that number is:
    • A. 

      35

    • B. 

      36

    • C. 

      45

    • D. 

      54

  • 37. 
    Which of the following is a prime number ?
    • A. 

      33

    • B. 

      81

    • C. 

      93

    • D. 

      97