C Language MCQS

Important C Language MCQs for preparation


1. In C, if you pass, an array as an argument, to a function, what actually, gets passed?

A) Base address of the array

B) Address of the last element of array

C) Value of elements in array

D) First element of the array


2. How “many times” the following, loop be, executed? {

.. ch=’b’; while (ch>=’a’ &&

ch<==’z) ch++; }

A) -1

B) 21

C) 25

D) -4


3. If a=8, and b=15, then the, statement

x=(a>b) ? a:b;

A) Assigns a value 15 to x

B) Assigns a value 7 to x

C) Assigns a value 8 to x

D) Gives an error message


4. What is, the “output the” following code.

int n=0, m=1; do (printf(“%d” m);

m++;}while (m=n);

A) 1

B) 5

C) 2

D) 8


5. A “C program” contains the, following declaration, int i8, j=5 what would, be the value, of following expression? abs(i-2%

A) 1

B) 7

C) 2

D) 9


6. The “output” of the, following is. Int a=75;  printf(“%d%%”, a);

A) 35%

B) 85%

C) 72%

D) None of the above


7. How ,many times, the following, program would, print (“abc”)?

main(){

printf(“nabc”); main( );}

A) 65535 times

B) Till the stack does not overflow

C) Infinite number of times

D) 32767 times


8. Which, of the, following is, the “correct usage of conditional operators” used in, C?

A) max=a>b?a>c?a:c:b>c?b:c

B) return (a>b)?(a:b);

C) a>b?c=30:c=40;

D) a>b?c=30;


9. What is, the “output the” following code.

int n=0, m=1; do (printf(“%d” m);

m++;}while (m=n);

A) 1

B) 5

C) 2

D) 8


10. In C, if you pass, an array as an argument, to a function, what actually, gets passed?

A) Base address of the array

B) Address of the last element of array

C) Value of elements in array

D) First element of the array


Leave a Reply

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

Back to top button