Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<math.h>
- #include<conio.h>
- //absolute value using abs function
- int main()
- {
- /*The absolute value of an integer is the numerical
- value without regard to whether the sign is negative or positive.
- "without requesting user input "
- int result=abs(enter any value);
- printf("%d",result); */
- int absolute_value;
- printf("Enter absolute value: \n");
- scanf("%d",&absolute_value);
- absolute_value=abs(absolute_value);
- printf("absolute value is : %d",absolute_value);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement