CodeSolved

Solved Programming Questions & Exercises

Comparison of two numbers (no conditional commands)

Practice Easy 911/ Download 1042 Views

Write a program that receives two A and B numbers from the user and checks whether the number A is larger than the number B. The output should be true or false.


Tip: In this exercise you should not use conditional commands like if. (The use of comparative operators is permitted)

19 Answers

This answer is only visible to premium members
This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error'
alert(msg) 
This answer is only visible to premium members
This answer is only visible to premium members

This answer is only visible to premium members

Subscription is currently unavailable.
This answer is only visible to premium members
This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error'
alert(msg) 
This answer is only visible to premium members
This answer is only visible to premium members

This answer is only visible to premium members

Subscription is currently unavailable.
This answer is only visible to premium members
This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error'
alert(msg) 
This answer is only visible to premium members
This answer is only visible to premium members

This answer is only visible to premium members

Subscription is currently unavailable.
# Here the user's numbers are taken from the user
number_1 = float(input('enter number: '))
number_2 = float(input('enter number: '))
# The comparison is done here and the result is printed in the output
print(number_1 > number_2)
Amirsaleh Download Python
a = int(input("Adad Aval :"))
b = int(input("Adad Dovom :"))
print(a>b)
Programmer Download Python
a = int(input('Please enter a num 1 : '))
b = int(input('Please enter a num 2 : '))
c = a > b
bool(c)
print(c)
a = int(input("enter your number a:"))
b = int(input("enter your number b:"))
c = a > b
print(bool(c))
Sumy.amiri Download Python
a = input("a :")
b = input("b :")
print(a > b)
,....................
a = int(input("a :"))
b = int(input("b :"))
print(a > b)
J1625 Download Python
<< Previous page 1 2 Next page >>

Submit answer

Submitting answers is currently unavailable.

×
×
Close