summaryrefslogtreecommitdiff
path: root/858/CH2/EX2.17/example_17.sce
blob: 9a7ffc6a889e434c191960728f2ccce79502b4a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
clc
clear 
printf("example 2.17 page number 77\n\n")

//to find molecular foemula 
C=93.75    //% of carbon
H2=6.25    //% of hydrogen
x=C/12     //number of carbon atoms
y=H2/2     //number of hydrogen atoms
molar_mass=64
density=4.41*29;

ratio=density/molar_mass;

x=ratio*5;
y=ratio*4;


printf("x = %f, y = %f",x,y)
printf("\n\nformula of butyric acid is = C10H8")