C Language MCQ’S | Declarations and Initializations

Exercise :: Declarations and Initializations – General Questions
Declarations and Initializations – General Questions
Declarations and Initializations – Find Output of Program
Declarations and Initializations – Point Out Errors
Declarations and Initializations – Point Out Correct Statements
Declarations and Initializations – True / False Questions
Declarations and Initializations – Yes / No Questions

11.
Is it true that a global variable may have several declarations, but only one definition?

A. Yes
B. No

12.
Which of the following operations are INCORRECT?

A.
int i = 35; i = i%5;
B.
short int j = 255; j = j;
C.
long int k = 365L; k = k;
D.
float a = 3.14; a = a%3;

13.
Point out the error in the following program (if it is compiled with Turbo C compiler).

#include<stdio.h>
int main()
{
display();
return 0;
}
void display()
{
printf(“Welcome to rajeshshuklacatalyst.com”);
}
A. No error
B. display() doesn’t get invoked
C. display() is called before it is defined
D. None of these

14.
What is the output of the program

#include<stdio.h>
int main()
{
int x = 10, y = 20, z = 5, i;
i = x < y < z;
printf(“%d\n”, i);
return 0;
}
A. 0
B. 1
C. Error
D. None of these

15.
A float is 4 bytes wide, whereas a double is 8 bytes wide.

A. True
B. False