Explain your own answer with proper example?
Type casting is a way to convert a variable from one data type to another data type.In simple terms type casting is conversion of variables into different datatypes.
Considering the following example:
#include <stdio.h>
int main ()
{
float x;
x = (float) 7/5;
printf(“%f”,x);
}
In the given C program, 7/5 alone will produce integer value as 1.
So, type cast is done before division to retain float value (1.4).