write the code to construct the greatest odd number from the user entered number using single array | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

write the code to construct the greatest odd number from the user entered number using single array

code using c, c++, java or python but the input should be of users choice and by using single array, we the greatest odd number as result and the result must contain all the entered number

1st Oct 2018, 2:26 PM
ANKUR KUMAR AGARWAL
ANKUR KUMAR AGARWAL - avatar
2 Answers
+ 1
Your problem desciption makes it even more obfuscated. What does "result must contain all the entered number". What is user supposed to input? a number? an array? in python i'd do the following: a = int(input()) while a: if a&1: break a-=1 print(str(a)+" is the greatest odd number")
1st Oct 2018, 7:46 PM
strawdog
strawdog - avatar
+ 1
sorry strawdog this is not the result of my question
6th Oct 2018, 1:36 AM
ANKUR KUMAR AGARWAL
ANKUR KUMAR AGARWAL - avatar