Tech Study

Write a Python function to find the Max of three numbers

Introduction

Write a Python function to find the Max of three numbers. I have used python 3.7 compiler for debugging purpose.

def max_of_two( x, y ):
    if x > y:
        return x
    return y
def max_of_three( x, y, z ):
    return max_of_two( x, max_of_two( y, z ) )
print("max number among three is:")
print(max_of_three(10, 30, 20))

Result

Write a Python function to find the Max of three numbers
Write a Python function to find the Max of three numbers

TaggedWrite a Python function to find the Max of three numbers

Java Final keyword

Introduction : java final keyword The final keyword present in Java programming language is generally used for restricting the user. …

Read more

C++ Memory Management: new and delete

C++ Memory Management We know that arrays store contiguous and the same type of memory blocks, so memory is allocated …

Read more