wiz-icon
MyQuestionIcon
MyQuestionIcon
1
You visited us 1 times! Enjoying our articles? Unlock Full Access!
Question

The formula E = mc2 states that the equivalent energy (E) can be calculated as the mass (m) multiplied by the speed of light (c = about 3×108 m/s) squared. Write a program that accepts the mass of an object and determines its energy.

Open in App
Solution

The formula is given as:
E = mc2
where, E ⇒ energy measured in Joule,
m ⇒ mass in Kilogram,
c ⇒ speed of light in m/s.

Program:
#Program to calculate the equivalent energy of an object
#asking for the mass in grams

mass = float(input("Enter the mass of object(in grams): "))

#Speed of light is known and given in the question
c = 3 * 10 ** 8

#calculating the energy, mass is divided by 1000 to convert it into kilogram
Energy = (mass/1000) * c ** 2

#printing the output
print("The energy of an object with mass",mass," grams is",Energy,"Joule.")


OUTPUT:
Enter the mass of object(in grams): 25
The energy of an object with mass 25.0 grams is 2250000000000000.0 Joule.

flag
Suggest Corrections
thumbs-up
17
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Photoelectric Effect
CHEMISTRY
Watch in App
Join BYJU'S Learning Program
CrossIcon