Float Arithmetic Operations in C Programming Language
Float Arithmetic Operations:
1 2 3 4 5 6 7 8 9 10 11 12 |
/*Program to understand the floating point arithmetic operation */ #include<stdio.h> int main(void) { float a=12.4, b=3.8; printf("Sum = %.2f \n", a+b); printf("Difference = %.2f \n", a-b); printf("Product = %.2f \n", a*b); printf("a/b = %.2f \n", a/b); return 0; } |
Program Output:
1 2 3 4 |
Sum = 16.20 Difference = 8.60 Product = 47.12 a/b = 3.26 |
2 Responses
[…] C Program to understand float arithmetics […]
[…] C Program to understand float arithmetics […]