Header Ads Widget

Type conversion in C

 Type conversion :- 

                            Type conversion is a process of converting data of one type into another type there are two type of the type conversion in C-programming.

1) Implicit type conversion (Automatic type conversion):-

It is automatically done by the system internally without programmer intervention. Usually in a mixed operand expression all the lower data type are converted to the higher data type in the expression.


int main()
int x=10;
float y=5.5;
double z;
printf("Value of Z is %lf",z);
return 0;

In this example all the values are converted into double automatically by the system.

2) Explicit Type conversion:-

It is specifically written by the programmer in his code.


int main()
int x;
float y;
y=(float)10/3; // Type conversion
printf("x=%d \n",x);
return 0;

<<Pre - Operators in C                                Next - Decision making construct (if and else)>>

Recommended Post:

Hackerearth Problems:-

Hackerrank Problems:-

Data structure:-

Key points:-



Post a Comment