Top 80+ Solved C Language MCQ Questions Answer
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
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
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
Q. All keywords in C are in ____________
a. LowerCase letters
b. UpperCase letters
c. CamelCase letters
d. None of the mentioned
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
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;
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
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
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
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
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
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
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;