use of cast operator Program in C

use of cast operator Program in C
use of cast operator Program in C

/*P4.11 Program to illustrate the use of cast operator*/
#include<stdio.h>
int main(void)
{
	int x=5,y=2;
	float p,q;
	p=x/y;		
	printf("p=%f\n",p);
	q=(float)x/y;
	printf("q=%f\n",q);
	return 0;
}

Output:

p=2.000000
q=2.500000
c language tutorial learn c language study c language