6. WRITE A C PROGRAM TO EXPLAIN “TYPECASTING”

/*C program to explain “typecasting”*/

#include<stdio.h>
#include<conio.h>
Int main()
{
Int a,b,c;
float d;
a=1;b=2;c=4;
d=(float)(a+b+c)/3; <div class=”red”> /*type casting*/</div>
printf(“d=%f”,d);
getch();
return 0;
}

output

d = 2.133333

Comments