blob: d33b5365c1cfcd60efdc9ad6432399d9dd761e08 (
plain)
1
2
3
4
5
6
7
|
clc;
g=9.8; //gravitational constant in m/sec square
h=1.5; //height in m
m=2; //mass in kg
W=m*g*h; //calculating weight
disp(W,"Weight in Joule = "); //displaying result
disp(W,"Potential Energy in Joule = "); //displaying result
|