Top 80+ Solved C Language MCQ Questions Answer

From 16 to 30 of 63

Q. Which of the following declaration is illegal?

a. char *str = “string Contents”;

b. char str[] = “string Contents””;

c. char str[20] = “string Contents””;

d. char[] str = “string Contents””;

  • d. char[] str = “string Contents””;

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

a. immutable

b. mutable

c. const

d. volatile

  • c. const

Q. Which of the following is not a pointer declaration?

a. char a[10];

b. char a[] = {‘1’, ‘2’, ‘3’, ‘4’};

c. char *str;

d. char a;

  • d. char a;

Q. Which of the following statement is false?

a. A variable defined once can be defined again with different scope

b. A single variable cannot be defined with two different types in the same scope

c. A variable must be declared and defined at the same time

d. A variable refers to a location in memory

  • c. A variable must be declared and defined at the same time

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

a. True

b. False

c. True if it is declared static

d. None of the mentioned

  • b. False

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

a. %, *, /, +, –

b. %, +, /, *, –

c. +, -, %, *, /

d. %, +, -, *, /

  • a. %, *, /, +, –

Q. Which of the following is not an arithmetic operation?

a. a * = 10;

b. a / = 10;

c. a ! = 10;

d. a % = 10;

  • c. a ! = 10;

Q. Are logical operator sequence points?

a. True

b. False

c. Depends on the compiler

d. Depends on the standard

  • a. True

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

a. True

b. False

c. Depends on the compiler

d. Depends on the standard

  • a. True

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

a. True or False

b. 0 or 1

c. 0 if an expression is false and any positive number if an expression is true

d. None of the mentioned

  • b. 0 or 1

Q. Relational operators cannot be used on ____________

a. structure

b. long

c. strings

d. float

  • a. structure

Q. What does the following command line signify? prog1prog2

a. It runs prog1 first, prog2 second

b. It runs prog2 first, prog1 second

c. It runs both the programs, pipes output of prog1 to input of prog2

d. It runs both the programs, pipes output of prog2 to input of prog1

  • c. It runs both the programs, pipes output of prog1 to input of prog2

Q. What is the default return-type of getchar()?

a. char

b. int

c. char *

d. reading character doesn’t require a return-type

  • b. int
Subscribe Now

Get All Updates & News