types of type casting in c code example
Example 1: casting in c
#include <stdio.h>
#include <stdlib.h>
int main(){
int x = 7, y = 5;
float z;
z = (float)x / (float)y; /*Here the value of z is 1.400000*/
return 0;
}
Example 2: what is typecasting
Assigning a value of one type to a variable of another type is
known as Type Casting.
Auto-boxing; is a process when you take a primitive value and
assign into wrapper class object.
Un-boxing; is a process when you take Wrapper class object
and convert to primitive.