Q-18. Write a C program to find the absolute value of a number.
Author -
admin
July 09, 2019
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- int m = abs(-50); // m is assigned to 50
- int n = abs(23); // n is assigned to -23
- printf("Absolute value of m = %d\n", m);
- printf("Absolute value of n = %d \n",n);
- return 0;
- }