- 4
A program in python
Write a program that examines 3 variables-x,y,z and prints the largest odd number among them.If none of them is odd,it should print a message to that effect
10 ответов
+ 2
Post your own attempt😑
https://www.sololearn.com/post/142665/?ref=app
+ 4
Oh, great idea.
I'm waiting for it.
+ 3
I would request you to post your attempt before asking others. And also search for similar questions before posting to avoid duplicates.👍
+ 2
Ok i am posting my code in c++ pls check and tell me if there is any error
https://code.sololearn.com/cSkN0dDxgukp/?ref=app
0
Please prefer posting quizes in Activity Feed instead.
0
Its not a quiz i need help in the question
0
post.your.attempt.
0
if((x%2==0)&&(y%2==0)&&(z%2==0))
cout<<"There are no odd numbers";
if((x%2==1)&&(x>y)&&(x>z))
cout<<"x is the greatest odd number";
if((y%2==1)&&(y>x)&&(y>z))
cout<<"y is the greatest odd number";
if((z%2==1)&&(z>x)&&(z>y))
cout<<"z is the greatest odd number";
that should do it.
0
a=int(input("Enter 1st number : "))
b=int(input("Enter 2nd number : "))
c=int(input("Enter 3rd number : "))
if a%2==0 and b%2==0 and c%2==0:
print("All three number a,b,c are not odd");
else:
if a>b and a>c:
print("a=",a,"is largestnumber"
elif a>b and c>a:
print("b=",b,"is largestnumber)
else:
print("c=",c,"is largest number")