Abs >> Math.h Function >>
Syntax 1 [Return Double] :
Syntax 2 [Return Integer] :double abs(complex x);
int abs(int x);
- abs is not a function , it is macro.
- This Macro gives the absolute value of an integer.
- If abs is called when STDLIB.H has been included, it is treated as a macro that expands to inline code.
- If you want to use the abs function instead of the macro, include #undef abs in your program, after the #include <STDLIB.H>.
Output :#include<stdio.h> #include< math.h> int main(void) { int number = -1234; printf("number: %d absolute value: %d\n", number, abs(number)); return 0; }
number : -1234 absolute value : 1234

0 comments
Post a Comment
Your Feedback :This is Growing Site and Your Feedback is important for Us to improve the Site performance & Quality of Content.Feel Free to contact and Please Provide Name & Contact Email