Top 80+ Solved C Language MCQ Questions Answer

From 1 to 15 of 63

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

a. int __a3;

b. int __3a;

c. int __A3;

d. None of the mentioned

  • d. None of the mentioned

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

a. int _a3;

b. int a_3;

c. int 3_a;

d. int _3a

  • c. int 3_a;

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

a. It is not standardized

b. To avoid conflicts since assemblers and loaders use such names

c. To avoid conflicts since library routines use such names

d. To avoid conflicts with environment variables of an operating system

  • c. To avoid conflicts since library routines use such names

Q. All keywords in C are in ____________

a. LowerCase letters

b. UpperCase letters

c. CamelCase letters

d. None of the mentioned

  • a. LowerCase letters

Q. Variable name resolution (number of significant characters for the uniqueness of variable) depends on___________

a. Compiler and linker implementations

b. Assemblers and loaders implementations

c. C language

d. None of the mentioned

  • a. Compiler and linker implementations

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

a. int number;

b. float rate;

c. int variable_count;

d. int $main;

  • d. int $main;

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

a. They can contain alphanumeric characters as well as special characters

b. It is not an error to declare a variable to be one of the keywords(like goto, static)

c. Variable names cannot start with a digit

d. Variable can be of any length

  • c. Variable names cannot start with a digit

Q. What is short int in C programming?

a. The basic data type of C

b. Qualifier

c. Short is the qualifier and int is the basic data type

d. All of the mentioned

  • c. Short is the qualifier and int is the basic data type

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

a. char

b. int

c. float

d. double

  • b. int

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

a. signed short

b. unsigned short

c. long

d. int

  • b. unsigned short

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

a. typedef int Boolean;

b. typedef enum {Mon, Tue, Wed, Thu, Fri} Workdays;

c. struct {char name[10], int age};

d. all of the mentioned

  • d. all of the mentioned

Q. What is the size of an int data type?

a. 4 Bytes

b. 8 Bytes

c. Depends on the system/compiler

d. Cannot be determined

  • c. Depends on the system/compiler

Q. enum types are processed by _________

a. Compiler

b. Preprocessor

c. Linker

d. Assembler

  • a. Compiler

Q. Which of the following statement is false?

a. Constant variables need not be defined as they are declared and can be defined later

b. Global constant variables are initialized to zero

c. const keyword is used to define constant values

d. You cannot reassign a value to a constant variable

  • a. Constant variables need not be defined as they are declared and can be defined later

Q. Which of the following declaration is not supported by C?

a. String str;

b. char *str;

c. float str = 3e2;

d. Both String str; & float str = 3e2;

  • a. String str;
Subscribe Now

Get All Updates & News