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 […]