250+ TOP MCQs on Pointers and Function Arguments and Answers

C helps anyone preparing for Citrix and other companies C interviews. One should practice these Objective Questions and answers continuously for 2-3 months to clear Citrix interviews on C Programming language.

Here is a listing of C Objective Questions on “Pointers and Function Arguments”:

1. Which of the following can never be sent by call-by-value?
a) Variable
b) Array
c) Structures
d) Both Array and Structures
Answer: b
Clarification: None.

2. Which type of variables can have the same name in a different function?
a) Global variables
b) Static variables
c) Function arguments
d) Both static variables and Function arguments
Answer: d
Clarification: None.

3. Arguments that take input by user before running a program are called?
a) Main function arguments
b) Main arguments
c) Command-Line arguments
d) Parameterized arguments
Answer: c
Clarification: None.

4. What is the maximum number of arguments that can be passed in a single function?
a) 127
b) 253
c) 361
d) No limits in number of arguments
Answer: b
Clarification: None.

5. What will be the output of the following C code?

  1.     #include 
  2.     void m(int *p, int *q)
  3.     {
  4.         int temp = *p; *p = *q; *q = temp;
  5.     }
  6.     void main()
  7.     {
  8.         int a = 6, b = 5;
  9.         m(&a, &b);
  10.         printf("%d %dn", a, b);
  11.     }

a) 5 6
b) 6 5
c) 5 5
d) 6 6
Answer: a
Clarification: None.

6. What will be the output of the following C code?

  1.     #include 
  2.     void m(int *p)
  3.     {
  4.         int i = 0;
  5.         for(i = 0;i < 5; i++)
  6.         printf("%dt", p[i]);
  7.     }
  8.     void main()
  9.     {
  10.         int a[5] = {6, 5, 3};
  11.         m(&a);
  12.     }

a) 0 0 0 0 0
b) 6 5 3 0 0
c) Run time error
d) 6 5 3 junk junk
Answer: b
Clarification: None.

7. What will be the output of the following C code?

  1.     #include 
  2.     void m(int p, int q)
  3.     {
  4.         int temp = p;
  5.         p = q;
  6.         q = temp;
  7.     }
  8.     void main()
  9.     {
  10.         int a = 6, b = 5;
  11.         m(a, b);
  12.         printf("%d %dn", a, b);
  13.     }

a) 5 6
b) 5 5
c) 6 5
d) 6 6
Answer: c
Clarification: None.

8. What will be the output of the following C code?

  1.     #include 
  2.     void m(int p, int q)
  3.     {
  4.         printf("%d %dn", p, q);
  5.     }
  6.     void main()
  7.     {
  8.         int a = 6, b = 5;
  9.         m(a);
  10.     }

a) 6
b) 6 5
c) 6 junk value
d) Compile time error
Answer: d
Clarification: None.

9. What will be the output of the following C code?

  1.     #include 
  2.     void m(int p)
  3.     {
  4.         printf("%dn", p);
  5.     }
  6.     void main()
  7.     {
  8.         int a = 6, b = 5;
  9.         m(a, b);
  10.         printf("%d %dn", a, b);
  11.     }

a) 6
b) 6 5
c) 6 junk value
d) Compile time error
Answer: d
Clarification: None.

Leave a Reply

Your email address will not be published. Required fields are marked *