summaryrefslogtreecommitdiff
path: root/24/CH20/EX20.3/Example20_3.sce
blob: 0757619df652bc143889d67834d8bcb0eb7f55d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
//Given that
n = [5, 11, 32, 67, 89]

//Sample Probelm 20-3a
printf("**Sample Problem 20-3a**\n")
navg = sum(n)/length(n)
printf("The average value of numbers is %2.2f\n", navg)

//Sample Probelm 20-3b
printf("\n**Sample Problem 20-3b**\n")
nrms = sqrt(sum(n.*n)/5)
printf("The rms value of numbers is %2.2f", nrms)