Top 50+ Solved Introduction to C Language MCQ Questions Answer

From 1 to 15 of 20

Q. What is the type of the following assignment expression if x is of type float and y is of type int?y = x + y;

a. int

b. float

c. there is no type for an assignment expression

d. double

  • a. int

Q. Operation “a = a * b + a” can also be written as ___________

a. a *= b + 1;

b. (c = a * b)!=(a = c + a);

c. a = (b + 1)* a;

d. All of the mentioned

  • d. All of the mentioned

Q. In expression i = g() + f(), first function called depends on __________

a. Compiler

b. Associativiy of () operator

c. Precedence of () and + operator

d. Left to write of the expression

  • a. Compiler

Q. Which operators of the following have same precedence? P. "!=", Q. "+=", R. "<<="

a. P and Q

b. Q and R

c. P and R

d. P, Q and R

  • b. Q and R

Q. Comment on the following statement n = 1; printf("%d, %dn", 3*n, n++);

a. Output will be 3, 2

b. Output will be 3, 1

c. Output will be 6, 1

d. Output is compiler dependent

  • d. Output is compiler dependent

Q. Which is correct representation of C statement? e = a * b + c / d * f;

a. e = (a * (b +(c /(d * f))));

b. e = ((a * b) + (c / (d * f)));

c. e = ((a * b) + ((c / d)* f));

d. Both e = ((a * b) + (c / (d * f))); and e = ((a * b) + ((c / d)* f));

  • d. Both e = ((a * b) + (c / (d * f))); and e = ((a * b) + ((c / d)* f));

Q. While swapping 2 no’ what at precautions to be taken care? b = (b / a); a = a * b; b = a / b;

a. Data type should be either of short, int and long

b. Data type should be either of float and double

c. All data types are accepted except for (char *)

d. This code doesn’t swap 2 numbers

  • b. Data type should be either of float and double

Q. function tolower(c) defined in library <ctype.h> works for ___________

a. Ascii character set

b. Unicode character set

c. Ascii and utf-8 but not EBCDIC character set

d. Any character set

  • d. Any character set

Q. Which type of conversion is NOT accepted?

a. From char to int

b. From float to char pointer

c. From negative int to char

d. From double to char

  • b. From float to char pointer

Q. Which of the following type-casting have chances for wrap around?

a. From int to float

b. From int to char

c. From char to short

d. From char to int

  • b. From int to char

Q. Which of the following typecasting is accepted by C?

a. Widening conversions

b. Narrowing conversions

c. Widening & Narrowing conversions

d. None of the mentioned

  • c. Widening & Narrowing conversions

Q. When do you need to use type-conversions?

a. The value to be stored is beyond the max limit

b. The value to be stored is in a form not supported by that data type

c. To reduce the memory in use, relevant to the value

d. All of the mentioned

  • d. All of the mentioned
Subscribe Now

Get All Updates & News