Energy is calculated as E=mc^2 where m is a mass of the object and c is a velocity of a light and Write a program that accepts an object's mass (in Kg) and velocity (in ms^-1) and Display its energy.

                                           

Energy is calculated as E=mc^2, where m is a mass of the object and c is a velocity of a light. Write a program that accepts an object's mass (in Kg) and velocity (in ms^-1). Display its energy.

PROGRAM:

m=float(input("Enter the mass of an object in kg:"))
c=3*(10**8)
energy=m*(c**2)
print("Energy of an object with mass "+str(m)+"kg is",energy,"J")

OUTPUT:

No comments:

Post a Comment




Copyright Ⓒ 2022 | Mechpedia | All Right Reserved.