What is the difference between functions abs() and fabs()?



What is the difference between functions abs() and fabs()?..

Answer / Bhuwan Chandra Pandey

In C programming, 'abs(x)' is a library function provided by stdlib.h that calculates the absolute value of an integer (signed) argument 'x'. On the other hand, 'fabs(x)' is also from stdlib.h but it computes the absolute value for a floating-point number 'x'.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

what is the difference between const volatile int i & volatile const int j;

2 Answers   HCL,


please send me the code for multiplying sparse matrix using c

1 Answers  


How can type-insensitive macros be created?

1 Answers  


What is a nested formula?

1 Answers  


In which language linux is written?

1 Answers  


any limit on the number of functions that might be present in a C program a) max 35 functions b) max 50 functions c) no limit d) none of the above

1 Answers  


why ordinary variable store the later value not the initial

1 Answers  


What is structure in c language?

1 Answers  


what is the output of the program?? #include<stdio.h> main ( ) { int a=010,sum=0,tracker: for(tracker=0;tracker<=a;tracker++) sum+=tracker; printf(ā€œ %d\nā€,sum); } what is the difference between a=10 and a=010??

3 Answers   Oracle,


what are the files which are automatically opened when a c file is executed?

3 Answers  


What is the general form of function in c?

1 Answers  


WHAT IS FLOAT?

3 Answers  


Categories