Log In Register

Units


Basics Of Functions - Questions and Answers

 

Practice these Basics Of Functions under C Programming walk-in interview Questions/ examination questions with best tricks and short cuts with solution. Student (candidate) who want to crack the walk in interview, competitive exams and want to find short cuts and tricks to solve questions on Basics Of Functions for following purpose.


– Anyone who is wishing to increase their perfect knowledge of Basics Of Functions of C Programming.
– Anyone who is preparing for aptitude test and increase his in depth aptitude knowledge C Programming specifically Basics Of Functions.
– Anyone who is preparing for interviews (competitive examinations, govt examinations and bank examinations, off-campus or on campus interviews, walk-in interview and company interviews) having questions on Basics Of Functions under C Programming.

– Anyone who is preparing for aptitude test or competitive exam or entrance exam.
– Anyone who is preparing for entrance examinations and other competitive examinations.
– All Experienced, Freshers and Students.

Here is list of Questions and Answers covering all key area of  Basics Of Functions topic of C Programming:

 

1.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     void main()
  3.     {
  4.         static int x = 3;
  5.         x++;
  6.         if (x <= 5)
  7.         {
  8.             printf("hi");
  9.             main();
  10.         }
  11.     }

Answer: Option A

Explanation:

2.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     int main()
  3.     {
  4.         void foo();
  5.         void f()
  6.         {
  7.             foo();
  8.         }
  9.         f();
  10.     }
  11.     void foo()
  12.     {
  13.         printf("2 ");
  14.     }

Answer: Option A

Explanation:

3.

What is the output of this C code?

  1.     include <stdio.h>
  2.     void m()
  3.     {
  4.         printf("hi");
  5.     }
  6.     void main()
  7.     {
  8.         m();
  9.     }

Answer: Option D

Explanation:

4.

Which function definition will run correctly?

Answer: Option A

Explanation:

5.

Which of the following is a correct format for declaration of function?

Answer: Option C

Explanation:

6.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     int main()
  3.     {
  4.         void foo(), f();
  5.         f();
  6.     }
  7.     void foo()
  8.     {
  9.         printf("2 ");
  10.     }
  11.     void f()
  12.     {
  13.         printf("1 ");
  14.         foo();
  15.     }

Answer: Option C

Explanation:

7.

Which of the following function declaration is illegal?

Answer: Option D

Explanation:

8.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     void m();
  3.     void n()
  4.     {
  5.         m();
  6.     }
  7.     void main()
  8.     {
  9.         void m()
  10.         {
  11.             printf("hi");
  12.         }
  13.     }

Answer: Option C

Explanation:

9.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     int main()
  3.     {
  4.         void foo();
  5.         printf("1 ");
  6.         foo();
  7.     }
  8.     void foo()
  9.     {
  10.         printf("2 ");
  11.     }

Answer: Option D

Explanation:

10.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     void foo();
  3.     int main()
  4.     {
  5.         void foo();
  6.         foo();
  7.         return 0;
  8.     }
  9.     void foo()
  10.     {
  11.         printf("2 ");
  12.     }

Answer: Option C

Explanation:

11.

The value obtained in the function is given back to main by using ________ keyword?

Answer: Option D

Explanation:

12.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     void main()
  3.     {
  4.         m();
  5.     }
  6.     void m()
  7.     {
  8.         printf("hi");
  9.         m();
  10.     }

Answer: Option B

Explanation:

13.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     void foo();
  3.     int main()
  4.     {
  5.         void foo(int);
  6.         foo();
  7.         return 0;
  8.     }
  9.     void foo()
  10.     {
  11.         printf("2 ");
  12.     }

Answer: Option C

Explanation:

14.

What is the output of this C code?

  1.     #include <stdio.h>
  2.     void main()
  3.     {
  4.         m();
  5.         void m()
  6.         {
  7.             printf("hi");
  8.         }
  9.     }

Answer: Option D

Explanation:

15.

Can we use a function as a parameter of another function? [ Eg: void wow(int func()) ].

Answer: Option B

Explanation: