Program to divide two floats in C

Source Code

// 4.ii. Program to divide two floats
// Arpan Das - CST 2nd Year (VOCLET)

#include <stdio.h>
//#include <conio.h>
#include <stdlib.h>

void main () {
	float x, y;
	//clrscr();
	//system("cls");
	
	printf("\t\t..:: float division ::..\n\n");
	printf("Please enter values for dividend and divider respectively: ");
	scanf("%f%f", &x, &y);
	printf("\nDivision: %f / %f = %f", x, y, x/y);
	
	//getch();
}

Output

		..:: float division ::..

Please enter values for dividend and divider respectively: 50 4

Division: 50.000000 / 4.000000 = 12.500000

Leave a Reply

Note: Your email address will not be published. Required fields are marked *