Write a shell script to compute mean and standard deviation of three numbers
Answers
Answered by
0
Explanation:
Mujhe hindi nahi aati lekin urdu aati hain
Answered by
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
English,
5 months ago
Hindi,
5 months ago
Science,
5 months ago
Social Sciences,
9 months ago
Computer Science,
9 months ago
Math,
1 year ago