
surajkumarrr
@surajkumarrr
The fabs function in C, found in <math.h>, computes the absolute value of a floating-point number. It takes a double and returns a double. Example usage:
c
Copy
Edit
#include <math.h>
#include <stdio.h>
int main() {
double num = -12.34;
printf("Absolute value of %.2f is %.2f\n", num, fabs(num));
return 0;