Header Ads Widget

Data type in C- language.

 C provides various types of data-types which allow the programmer to select the appropriate type for the variable to set its value. Data-type is used to identify the type of the variable when it declare. And also used in identify the type of the value returned by the function.

C have three type of the data-type:-

  1. Primary (built-in ) data types:-   Void , int ,  char, float, double.
  2. Derived data Types :-  Array , pointer .
  3. User define data types :- structure , union and enumeration .
Primary Data Types :- 

Void: It holds no value and is generally used for specifying the type of function or what it returns. If the function has a void type, it means that the function will not return any value.

Int :- It is used to declare the integer type values. For int we use %d .

Char :- it is used for character type values. For char we use %c .

float , Double :-  It is used for floating numbers. For float we use %f and for double we use %lf.

All the data type have a specific range they can not store the value greater than that range value . and range of the data type is depending on the compiler (16 bit or 32 bit) . 

Video Lecture:-





<<Pre - warmup program                                        Next - Operators in C>>




Recommended Post:

Hackerearth Problems:-

Hackerrank Problems:-

Data structure:-

Key points:-

 MCQs:-