CodeSolved

A comprehensive source of programming questions and exercises

Calculate the volume of the rectangular cube

Practice Easy 324/ Download 1287 Views

Write a program that receives the length, width and height of the rectangular cube and calculate its volume

Cuban volume of rectangle = length * width * height

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.
s=int(input('لطفا طول مستطیل را وارد کنید'))
b=int(input('لطفا عرض مستطیل را وارد کنید'))
c=int(input('لطفا ارتفاع مستطیل را وارد کنید'))
if s>0 , b>0 , c>0 :
else :
  print('error')
p=s*b*c
print(p)
User 2356 Download Python
t=float(input("t:"))
a=float(input("a:"))
e=float(input("e:"))
ha=(t*a*e)
print(ha)
n1=float(input("Enter first number: "))
n2=float(input("Enter second number: "))
n3=float(input("Enter third number: "))
print(n1*n2*n3)
Feribanoo Download Python
def masahat_rectangle():
    length = int(input("Enter the length of the rectangle: "))
    width = int(input("Enter the width of the rectangle: "))
    height = int(input("Enter the height of the rectangle: "))
    print("The volume of the rectangle is: ", length * width * height)
masahat_rectangle()
User 3116 Download Python
tool = float(input("lotfan andazeye toole ra bar hasbe cm vared konid: "))
arz = float(input("lotfan andazeye arz ra bar hasbe cm vared konid: "))
ertefa = float(input("lotfan andazeye ertefa ra bar hasbe cm vared konid: "))
print("hajme mokeab = ", tool * arz * ertefa , "cm**3")
tole=float(input("enter the toel:"))
arze=float(input("enter the arze:"))
artefa=float(input("enter the artefa:"))
result=tole*arze*artefa
print(result)
Roghaye.m Download Python
def calculate_volume(length, width, height):
    """محاسبه حجم مکعب مستطیل."""
    return length * width * height

def main():
    try:
        # Get the length, width and height of the user
        length = float(input("لطفاً طول مکعب مستطیل را وارد کنید: "))
        width = float(input("لطفاً عرض مکعب مستطیل را وارد کنید: "))
        height = float(input("لطفاً ارتفاع مکعب مستطیلی را وارد کنید: "))
        
        # Volume calculation
        volume = calculate_volume(length, width, height)
        
        # Display the result
        print(f"حجم مکعب مستطیل برابر است با: {volume:.2f}")
    except ValueError:
        print("لطفاً اعداد صحیح یا اعشاری وارد کنید.")

# Implementation of the main function
if __name__ == "__main__":
    main()
Mma123 Download Python
<< Previous page 1 2 Next page >>

Submit answer

Submitting answers is currently unavailable.

Related content

Detection using AI
×
×
Close