--> //initializations

--> M=1000 //gm (mass of wet soil)
 M  = 

   1000.


--> M3=2000 //gm (mass of pycnometer with soil and filled with water)
 M3  = 

   2000.


--> M4=1480 //gm (mass of pycnometer filled with water only)
 M4  = 

   1480.


--> G=2.67 //(specific gravity)
 G  = 

   2.67


--> D=2.05 //gm/ml (bulk density of soil)
 D  = 

   2.05


--> Yw=1.0 //gm/ml (unit weight of water)
 Yw  = 

   1.


--> //calculations

--> w=((M/(M3-M4))*((G-1)/G))-1 //(water content)
 w  = 

   0.2028234


--> Dd=D/(1+w) //(dry density)
 Dd  = 

   1.7043234


--> e=((G*Yw)/Dd)-1 //(void ratio)
 e  = 

   0.5666041


--> S=(w*G*100)/e //(degree of saturation)
 S  = 

   95.576159


--> //results

--> printf('water content=%f',(w*100)) //%
water content=20.282339
--> printf('degree of saturation=%f',S) //%
degree of saturation=95.576159