Computer Science, asked by XAkashDubeyX23901, 9 months ago

Write a shell script to compute mean and standard deviation of three numbers

Answers

Answered by mustqeem0009
0

Explanation:

Mujhe hindi nahi aati lekin urdu aati hain

Answered by mad210219
0

Compute mean and standard deviation of three numbers

Explanation:

 TYPE in SHELL:

read num1

read num2

read num3

let mean=($num1+$num2+$num3)/3

let n1=num1-mean

let n2=num2-mean

let n3=num3-mean

let sd=sqrt((($n1**$n1)($n2**$n2)($n3**$n3))/3)

echo ‘mean is :”$mean

echo ‘standard deviation is:’$sd’

In order to read input of three numbers we use

Read num1

Means read variable_naeme is the syntax

We access the value of any variable in shell using $  

So $num1 gives the number present in variable num1

Sqrt() uf function that computes the squae root of the passes numbers

We use echo’………………….’

To print any thing to the console

So we used  

Echo’mean is :’$mean

Similar questions