summaryrefslogtreecommitdiff
path: root/1427/CH5/EX5.20/5_20.sce
diff options
context:
space:
mode:
Diffstat (limited to '1427/CH5/EX5.20/5_20.sce')
-rw-r--r--1427/CH5/EX5.20/5_20.sce9
1 files changed, 9 insertions, 0 deletions
diff --git a/1427/CH5/EX5.20/5_20.sce b/1427/CH5/EX5.20/5_20.sce
new file mode 100644
index 000000000..f04fdbf6a
--- /dev/null
+++ b/1427/CH5/EX5.20/5_20.sce
@@ -0,0 +1,9 @@
+//ques-5.20
+//Calculating pH of HCl solution
+clc
+M=10^-8;//molarity of HCl
+D=M^2+4*(10^-14);//discriminant
+x=(-M+sqrt(D))/2;
+c=M+x;//content of hydrogen ion
+p=-log10(c);
+printf("pH value for given HCl is %.2f.",p);