C float division
// By default what '/' is doing is a simple euclidian division
// (The remainder is calculated with modulo '%')
// Casting both numbers to float will get you a nice decimal
float f = (float)a / (float)b
C float division
// By default what '/' is doing is a simple euclidian division
// (The remainder is calculated with modulo '%')
// Casting both numbers to float will get you a nice decimal
float f = (float)a / (float)b
C program for float division of numbers
#include <stdio.h>
void main() {
int a;
float b, c, d;
a = 750;
b = a / 350;
c = 750;
d = c / 350;
printf("%.2f %.2f", b, d);
// output: 2.00 2.14
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us