summaryrefslogtreecommitdiff
path: root/1991/CH2/EX2.18/18.sce
blob: b4b054c3f3f24e4cc011f4b73b1b6610b90a713e (plain)
1
2
3
4
5
6
7
8
9
10
clc
clear
//input
r=5500//radius
g1=6.7*10^-11
g=7//acceleration due to gravity
//calculation of mean density
p=3*g/(4*%pi*r*10^3*g1)//mean density
//output
printf("the mean density of planet is %3.3f kgm^-3",p)