CodeSolved

A comprehensive source of programming questions and exercises

Absolute value calculation

Practice Easy 1276/ Download 661 Views

Write a program that receives a number from the input and prints it in the output

11 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.
while True:    
    x = int(input("tell me a number: "))
    if x >= 0:
        print(x)
    elif x < 0:
        print(-x)
y = int(input("Enter a number: "))
if y >= 0:
    print(y)
else:
    print(-y)
Aref.2 Download Python
num1 = int(input('enter your number : '))
abs_num1 = abs(num1)   
print(f" The absolute value of the number {num1} is : {abs_num1}")
Zahra1392 Download Python
number = int(input("please enter a number: "))
print("ghadre motlagh = ", abs(number))
def ghadrmotlagh():
    x = int(input("enter number1:"))
    y = int(input("enter number2:"))
    z = abs(x-y)
    return z
print(ghadrmotlagh())
User 1355 Download Python
num = float(input ("Please enter number: "))
print(abs(num))
Behcoder Download Python
n = float(input())
if n * (-1) <= n :
    print(n)
else :
    print(n * (-1))

Arshia.a Download Python
<< Previous page 1 2 Next page >>

Submit answer

Submitting answers is currently unavailable.

×
×
Close