C MCQ set number 00698

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

Answer: b [Reason:] None.

2. Which type of variables can have same name in different function:
a) global variables
b) static variables
c) Function arguments
d) Both static variables and Function arguments

Answer

Answer: d [Reason:] 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

Answer: c [Reason:] None.

4. The maximum number of arguments that can be passed in a single function are_____________
a) 127
b) 253
c) 361
d) No limits in number of arguments

Answer

Answer: b [Reason:] None.

5. What is the output of this C code?

  1.     #include <stdio.h>
  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

Answer: a [Reason:] None.

6. What is the output of this C code?

  1.     #include <stdio.h>
  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

Answer: b [Reason:] None.

7. What is the output of this C code?

  1.     #include <stdio.h>
  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

Answer: c [Reason:] None.

8. What is the output of this C code?

  1.     #include <stdio.h>
  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

Answer: d [Reason:] None.

9. What is the output of this C code?

  1.     #include <stdio.h>
  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

Answer: d [Reason:] None.

ed010d383e1f191bdb025d5985cc03fc?s=120&d=mm&r=g

DistPub Team

Distance Publisher (DistPub.com) provide project writing help from year 2007 and provide writing and editing help to hundreds student every year.