C Technical Interview Questions – Datatypes – Objective Type

These C Technical Interview Questions Datatypes post providing basic, intermediate and Hard level examples in C data types. The practice of these examples makes you good in C programming.


What is the default value of int local variable?

  1. 0
  2. Garbage value
  3. Either 0 or garbage value
  4. None of the above

Answer :

Ans : 2 ; Local variables implicitly initializes with Garbage values

What is the default value of float global variable?

  1. 0.0
  2. 0
  3. 0.000000
  4. Garbage value

Answer:

Ans : 3; global variables initialized with default values based on data type and default value specifies up to 6 decimals

What are the limits of a signed short integer?

  1. -128 to +127
  2. -32768 to +32767
  3. 0 to 255
  4. 0 to 65535

Answer :

Ans : 2

What are the limits of an unsigned integer on the 16-bit compiler?

  1. -32768 to +32767
  2. 0 to 255
  3. 0 to 65535
  4. None of above.

Answer:

Ans : 3; On 16-bit compiler, integer size is 2 bytes

What are the limits of signed char data type?

  1. 0 to 255
  2. -128 to +127
  3. 0 to 128
  4. Either b or c depends on the compiler.

Answer :

Ans : 2 ; character size is 1 byte (range is 256) and it represents both positive and negative values

What is the size of a long data type in C?

  1. 8 bytes
  2. 4 or 8 bytes
  3. 4 bytes
  4. 2 or 4 bytes.

Answer :

Ans : 3 ; long data type means ‘long int’, hence the size is 4 bytes

What is character system?

  1. Used to store characters
  2. Converts symbols into binary
  3. Represents all the symbols of a language using constant integer values
  4. None of the above.

Answer :

Ans : 3 ;

What is the use of ASCII?

  1. To develop compiler program.
  2. To convert characters into integers
  3. To represent characters in integers
  4. Character system.
  5. All of above.

Answer :

Ans : 5 ; All the options are true in case of ASCII

Can we store character into integer variable?

  1. Yes
  2. Compile time error
  3. Runtime error
  4. Depends on the compiler.

Answer :

Ans : 1 ; yes allowed

Can we store float into integer variable?

  1. Yes, but stores 0
  2. Yes, stores integer part
  3. No
  4. None of above

Answer :

Ans : 1 ;

>C Technical Interview Questions on Datatypes | Objective Type Part 3<

Share this