text: Find Maximum and Minimum of two numbers using Absolute function | C program to find maximum and minimum using Absolute function ; Function to return maximum among the two numbers ; Function to return minimum among the two numbers ; Driver code ; Displaying the maximum value ; Displaying the minimum value
code: #include <stdio.h> NEW_LINE #include <stdlib.h> NEW_LINE int maximum ( int x , int y ) { return ( ( x + y + abs ( x - y ) ) / 2 ) ; } int minimum ( int x , int y ) { return ( ( x + y - abs ( x - y ) ) / 2 ) ; } void main ( ) { int x = 99 , y = 18 ; printf ( " Maximum : ▁ % d STRNEWLINE " , maximum ( x , y ) ) ; printf ( " Minimum : ▁ % d STRNEWLINE " , minimum ( x , y ) ) ; }