summaryrefslogtreecommitdiff
path: root/1553/CH23/EX23.1/23Ex1.sce
blob: e18d40e28a8e6da15169b1c1ab12161a68bc301b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Chapter 23 Ex1

clc;
clear;
close;

//(i)

n1=27; n2=3;
ans1=log(n1)/log(n2);
mprintf("log 27 to the base 3 is %d",ans1);

//(ii)

n3=(1/343); n4=7;
ans2=log(n3)/log(n4);
mprintf("\nlog (1/343) to the base 7 is %d",ans2);

//(iii)

n5=0.01; n6=100;
ans3=log(n5)/log(n6);
mprintf("\nlog 0.01 to the base 100 is %.0f",ans3);