Compile And Execute C Language Coding Quiz

25 Questions | Total Attempts: 59

SettingsSettingsSettings
Please wait...
Programming Language Quizzes & Trivia

Let's start this quiz it will give you the different functions of c language. Find out now how much do you know about it!


Questions and Answers
  • 1. 
    What will be output if you will compile and execute the following c code? #include<stdio.h> int main(){   int array[3]={5};   int i;   for(i=0;i<=2;i++)     printf("%d ",array[i]);   return 0; }
    • A. 

      5 garbage garbage

    • B. 

      5 0 0

    • C. 

      5 null null

    • D. 

      Compiler error

    • E. 

      None of above

  • 2. 
    What will be output if you will compile and execute the following c code? #include<stdio.h> void call(int,int,int); int main(){   int a=10;   call(a,a++,++a);   return 0; } void call(int x,int y,int z){   printf("%d %d %d",x,y,z); }
    • A. 

      10 10 12

    • B. 

      12 11 11

    • C. 

      12 12 12

    • D. 

      10 11 12

    • E. 

      Compiler error

  • 3. 
    What will be output if you will compile and execute the following c code? #include<stdio.h> int main(){   int x=5,y=10,z=15;   printf("%d %d %d");   return 0; }
    • A. 

      Garbage Garbage Garbage

    • B. 

      5 10 15

    • C. 

      15 10 5

    • D. 

      Compiler error

    • E. 

      Run time error

  • 4. 
    What will be output if you will compile and execute the following c code? #include<stdio.h> int main(){   register int i,x;   scanf("%d",&i);   x=++i + ++i + ++i;   printf("%d",x);   return 0; }
    • A. 

      17

    • B. 

      18

    • C. 

      21

    • D. 

      22

    • E. 

      Compiler error

  • 5. 
    What will be output if you will compile and execute the following c code? #include int main(){   int a=5;   int b=10;   {     int a=2;     a++;     b++;   }   printf("%d %d",a,b);   return 0; }
    • A. 

      5 10

    • B. 

      6 11

    • C. 

      5 11

    • D. 

      6 10

    • E. 

      Complier error

  • 6. 
    Which of the following type of class allows only one object of it to be created?
    • A. 

      Virtual class

    • B. 

      Abstract class

    • C. 

      Singleton class

    • D. 

      Friend class

  • 7. 
    Which of the following is not a type of constructor?
    • A. 

      Copy constructor

    • B. 

      Friend constructor

    • C. 

      Default constructor

    • D. 

      Parameterized constructor

  • 8. 
    Which of the following concepts means determining at runtime what method to invoke?
    • A. 

      Data hiding

    • B. 

      Dynamic Typing

    • C. 

      Dynamic binding

    • D. 

      Dynamic loading

  • 9. 
    Which of the following concept of oops allows compiler to insert arguments in a function call if it is not specified?
    • A. 

      Call by value

    • B. 

      Call by reference

    • C. 

      Default arguments

    • D. 

      Call by pointer

  • 10. 
    Which of the following is correct about the statements given below?
    1. All operators can be overloaded in C++.
    2. We can change the basic meaning of an operator in C++.
    • A. 

      Only I is true.

    • B. 

      Both I and II are false.

    • C. 

      Only II is true.

    • D. 

      Both I and II are true.

  • 11. 
    • A. 

      L

    • B. 

      Q

    • C. 

      N

    • D. 

      D

  • 12. 
    Look at this series: 2, 1, (1/2), (1/4), ... What number should come next?
    • A. 

      (1/3)

    • B. 

      (1/8)

    • C. 

      (2/8)

    • D. 

      (1/16)

  • 13. 
    Look at this series: 7, 10, 8, 11, 9, 12, ... What number should come next?
    • A. 

      7

    • B. 

      10

    • C. 

      12

    • D. 

      13

  • 14. 
    Look carefully for the pattern, and then choose which pair of numbers comes next. 28 25 5 21 18 5 14
    • A. 

      11 5

    • B. 

      10 7

    • C. 

      11 8

    • D. 

      5 10

    • E. 

      10 5

  • 15. 
    Look carefully for the pattern, and then choose which pair of numbers comes next. 9 11 33 13 15 33 17
    • A. 

      33 35

    • B. 

      19 33

    • C. 

      33 19

    • D. 

      15 33

    • E. 

      19 21

  • 16. 
    A is thrice as good as workman as B and therefore is able to finish a job in 60 days less than B. Working together, they can do it in:
    • A. 

      20 days

    • B. 

      22.5 days

    • C. 

      25 days

    • D. 

      30 days

  • 17. 
    A, B and C can do a piece of work in 20, 30 and 60 days respectively. In how many days can A do the work if he is assisted by B and C on every third day?
    • A. 

      12 days

    • B. 

      15 days

    • C. 

      16 days

    • D. 

      18 days

  • 18. 
    4 men and 6 women can complete a work in 8 days, while 3 men and 7 women can complete it in 10 days. In how many days will 10 women complete it?
    • A. 

      35

    • B. 

      50

    • C. 

      45

    • D. 

      40

  • 19. 
    10 women can complete a work in 7 days and 10 children take 14 days to complete the work. How many days will 5 women and 10 children take to complete the work?
    • A. 

      3

    • B. 

      5

    • C. 

      7

    • D. 

      Cannot be determined

    • E. 

      None of these

  • 20. 
    X and Y can do a piece of work in 20 days and 12 days respectively. X started the work alone and then after 4 days Y joined him till the completion of the work. How long did the work last?
    • A. 

      6 days

    • B. 

      10days

    • C. 

      15days

    • D. 

      20days

  • 21. 
    It was Sunday on Jan 1, 2006. What was the day of the week Jan 1, 2010?
    • A. 

      Sunday

    • B. 

      Saturday

    • C. 

      Friday

    • D. 

      Wednesday

  • 22. 
    The calendar for the year 2007 will be the same for the year:
    • A. 

      2014

    • B. 

      2016

    • C. 

      2017

    • D. 

      2018

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

      31

    • B. 

      61

    • C. 

      71

    • D. 

      91

  • 24. 
    The banker's discount on a bill due 4 months hence at 15% is Rs. 420. The true discount is:
    • A. 

      Rs. 400

    • B. 

      Rs. 360

    • C. 

      Rs. 480

    • D. 

      Rs. 320

  • 25. 
    A person crosses a 600 m long street in 5 minutes. What is his speed in km per hour?
    • A. 

      3.6

    • B. 

      7.2

    • C. 

      8.4

    • D. 

      10

Back to Top Back to top