C/C MCQ Quiz Hub

C Programming - MCQ Questions Set 1

Choose a topic to test your knowledge and improve your C/C skills

C99 standard guarantees uniqueness of __________ characters for internal names.





✅ Correct Answer: 2

C99 standard guarantees uniqueness of ___________ characters for external names.





✅ Correct Answer: 1

Which of the following is not a valid variable name declaration?





✅ Correct Answer: 4

Which of the following is not a valid variable name declaration?





✅ Correct Answer: 3

Why do variable names beginning with the underscore is not encouraged?





✅ Correct Answer: 3

All keywords in C are in _____





✅ Correct Answer: 1

Variable name resolution (number of significant characters for the uniqueness of variable) depends on ___________





✅ Correct Answer: 1

Which of the following is not a valid C variable name?





✅ Correct Answer: 4

Which of the following is true for variable names in C?





✅ Correct Answer: 3

Which is valid C expression?





✅ Correct Answer: 2

Which of the following is not a valid variable name declaration?





✅ Correct Answer: 4

What is the problem in the following variable declaration? float 3Bedroom-Hall-Kitchen?;





✅ Correct Answer: 4

Which of the following cannot be a variable name in C?





✅ Correct Answer: 1

The format identifier ‘%i’ is also used for _____ data type.





✅ Correct Answer: 2

Which data type is most suitable for storing a number 65000 in a 32-bit system?





✅ Correct Answer: 2

 Which of the following is a User-defined data type?





✅ Correct Answer: 4

What is the size of an int data type?





✅ Correct Answer: 3

What is short int in C programming?





✅ Correct Answer: 3

Which is correct with respect to the size of the data types?





✅ Correct Answer: 3

Which of the data types has the size that is variable?





✅ Correct Answer: 2

In the following code snippet, character pointer str holds a reference to the string ___________





✅ Correct Answer: 2

enum types are processed by _________





✅ Correct Answer: 1

Which of the following statement is false?





✅ Correct Answer: 1

Which of the following declaration is not supported by C?





✅ Correct Answer: 1

 Which of the following declaration is illegal?





✅ Correct Answer: 4

Which keyword is used to prevent any changes in the variable within a C program?





✅ Correct Answer: 3

Which of the following is not a pointer declaration?





✅ Correct Answer: 4

Which of the following statement is false?





✅ Correct Answer: 3

A variable declared in a function can be used in main().





✅ Correct Answer: 2

What is the precedence of arithmetic operators (from highest to lowest)?





✅ Correct Answer: 1

 Which of the following is not an arithmetic operation?





✅ Correct Answer: 3

Which of the following data type will throw an error on modulus operation(%)?





✅ Correct Answer: 4

Which among the following are the fundamental arithmetic operators, i.e, performing the desired operation can be done using that operator only?





✅ Correct Answer: 1

Are logical operator sequence points?





✅ Correct Answer: 1

Do logical operators in the C language are evaluated with the short circuit?





✅ Correct Answer: 1

What is the result of logical or relational expression in C?





✅ Correct Answer: 2

Which among the following is NOT a logical or relational operator?





✅ Correct Answer: 4

Relational operators cannot be used on ________





✅ Correct Answer: 1

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





✅ Correct Answer: 4

Which type of conversion is NOT accepted?





✅ Correct Answer: 2

What will be the data type of the result of the following operation? (float)a * (int)b / (long)c * (double)d





✅ Correct Answer: 4

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





✅ Correct Answer: 4

Which of the following typecasting is accepted by C?





✅ Correct Answer: 3

When do you need to use type-conversions?





✅ Correct Answer: 4

For which of the following, “PI++;” code will fail?





✅ Correct Answer: 1

What will be the final values of a and c in the following C statement? (Initial values: a = 2, c = 1) c = (c) ? a = 0 : 2;





✅ Correct Answer: 1

What will be the data type of the following expression? (Initial data type: a = int, var1 = double, var2 = float) expression (a < 50)? var1 : var2;





✅ Correct Answer: 3

Which expression has to be present in the following? exp1 ? exp2 : exp3;





✅ Correct Answer: 4

What will be the final value of c in the following C code snippet? (Initial values: a = 1, b = 2, c = 1) c += (-c) ? a : b;





✅ Correct Answer: 3

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





✅ Correct Answer: 1