Data Types In C Language: C Programming MCQ

Data Types In C Language. 20+ Multiple-Choice Questions on C Language Data Types.

C Data Types MCQ

 

Sizes of short, int, and long in a Turbo C C++ compiler in bytes are ??

A) 2, 2, 4
B) 2, 4, 4
C) 4, 8, 16
D) 8, 8, 16

 

A register variable is stored in a Register. Where does a Register Present in a Computer ??

A) RAM ( Random Access Memory )
B) ROM ( Read Only Memory )
C) CPU (Central Processing Unit )
D) DMA ( Direct Memory Access )

 

Sizes of short, int, and long in Visual Studio or GCC compiler in bytes are ??

A) 2, 2, 4
B) 2, 4, 4
C) 4, 4, 8
D) 4, 8, 8

 

Identify which of the following are declarations ??
1 : extern int x;
2 : float square ( float x ) { … }
3 : double pow(double, double);

A. 1
B. 2
C. 1 and 3
D. 3

 

Range of signed char and unsigned char are ??

A) -128 to +127 / 0 to 255
B) 0 to 255 / -128 to +127
C) -128 to -1 / 0 to +127
D) 0 to +127 / -128 to -1

 

C Language MCQ

 

Select the true statement ??

A) Variables of type auto are stored in Stack memory
B) Variable of type Static is stored in Segmented Memory
C) Variables of type register are stored in Micro Processor Memory
D) All the above

 

Ranges of signed int and unsigned int are ??

A) 0 to 65535 / -32768 to +32767
B) -32768 to +32767 / 0 to 65535
C) -32767 to +32768 / 0 to 65536
D) 0 to 65536 / -32767 to +32768

 

Variables of type auto, static and extern are all stored in ??

A) ROM
B) RAM
C) CPU
D) Compiler

 

Size of float, double and long double in Bytes are ??

A) 4, 8, 16
B) 4, 8, 10
C) 2, 4, 6
D) 4, 6, 8

 

Which among the following is a Local Variable ??

A) register
B) auto
C) static
D) extern

 

C Data Types MCQ

 

Range of singed long and unsigned long variables are ??
A) -2147483647 to +2147483648 0 to 4294967295
B) -2147483648 to +2147483647 0 to 4294967296
C) -2147483648 to +2147483647 0 to 4294967295
D) 0 to 4294967295 -2147483648 to +2147483647

 

Which among the following is a Global Variable ??

A) auto
B) register
C) static
D) extern

 

The range of float variable is ??

A) -3.2e38 to +3.2e38
B) -3.8e32 to +3.8e32
C) -3.4e34 to +3.4e34
D) -3.4e38 to +3.4e38

 

Which one of the following is correct ??

A) Register variables are usually fast retrieving variables
B) Static variables usually maintain their values between function calls
C) Auto variables release their memory after the block or function where they are declared
D) All the above

 

Leftmost bit 0 in Singed representation indicates ??

A) A Positive number
B) A Negative Number
C) An Unsigned number
D) None of the above

 

C Data Types MCQ

 

Choose a correct statement about the static variables ??

A) We can access a static global variable in other files
B) A static global variable can be used only in a file in which it is declared
C) A static global variable can not be declared without an extern keyword
D) Default value of a static variable is -1

 

If you do not specify a storage class for a Variable ??

A) You get a compiler error.
B) You get a compiler warning.
C) Output is null always
D) None of the above

 

What is the difference between Declaration and Definition ??
A) Declaration does allocate memory for a variable
The definition does allocate memory for a variable

B) Declaration does allocate memory for a variable
The definition does not allocate memory for a variable

C) Declaration does not allocate memory for a variable
The definition does allocate memory for a variable

D) Declaration does not allocate memory for a variable
The definition does not allocate memory for a variable

 

Choose the right statement ??

A) We don’t use a non-static global variable in included files
B) A non-static global variable can be used or referred to inside included files
C) A non-static global variable does not live till the end of program execution
D) None of the above

 

Choose the right statement ??

A) Redeclaration of a variable is Ok
B) Redefinition of a variable is not Ok
C) Definition of a variable uses memory blocks
D) All the above

 

Related Posts

Leave a Comment

Your email address will not be published. Required fields are marked *

error: Content is protected !!