human
Write me a code to middle of three using minimum comparisons and the other steps required given the following:
Middle of three using minimum comparisons | Function to find the middle of three numbers.
Compare each three number to find middle number . Enter only if a > b.
Decided a is not greater than b ..
Driver Code"
Solution in Python:
assistant
#Here is code to middle of three using minimum comparisons and the other steps required.
 def middleOfThree ( a , b , c ) :
	if a > b :
		if ( b > c ) :
			return b
		elif ( a > c ) :
			return c
		else :
			return a
	else :
		if ( a > c ) :
			return a
		elif ( b > c ) :
			return c
		else :
			return b
a = 20
b = 30
c = 40
print ( middleOfThree ( a , b , c ) )