Home » Python » Python programs

Python program to find the maximum ODD number

Finding maximum ODD number: Here, we are going to implement a python program that will input N number and find the maximum ODD number.
Submitted by Anuj Singh, on August 06, 2019

Input N integer numbers and we have to find the maximum odd number.

There are many ways of doing this but this time, we have to thought of most computationally efficient algorithm to do so.

Python code to find the maximum ODD number

# Python code to find the maximum ODD number 

n = 0		# loop counter
num = 0		# to store the input
maxnum = 0	# to store maximum ODD number

# loop to take input 10 number
while n<10:
    num = int(input("Enter your number: "))
    if num%2 != 0:
        if num > maxnum:
            maxnum = num
    n += 1

# printing the 	maximum ODD number
print("The maximum ODD number :",maxnum)

Output

Enter your number: 121
Enter your number: 234
Enter your number: 561
Enter your number: 800
Enter your number: 780
Enter your number: 870
Enter your number: 122
Enter your number: 345
Enter your number: 679
Enter your number: 986
The maximum ODD number : 679





Comments and Discussions

Ad: Are you a blogger? Join our Blogging forum.




Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates


© https://www.includehelp.com some rights reserved.