Thursday, May 19, 2016

A c program for type casting

Program
#include<stdio.h>
main()
{
int a,b;
float c;
printf("enter the values of a and b: \n");
scanf("%d%d",&a.&b);
c=(float)a/b;
printf("type casted value is:%f",c);
}

Output
enter the values of a and b:
4 6
type casted value is:0.666666
 

No comments:

Post a Comment