bc -l is the key point here (and rounding error in $sd1 / 3)
$ echo 10/3 | bc
3
$ echo 10/3 | bc -l
3.33333333333333333333
Using a here document you can do everything in bc:
echo "Enter three integers with space between"
read a b c
bc -l << _EOT_
a=$a; b=$b; c=$c
sum=a+b+c
mean=sum/3
d1=a-mean
d2=b-mean
d3=c-mean
s1=d1*d1
s2=d2*d2
s3=d3*d3
sd1=s1+s2+s3
sd1=sd1/3
d=sqrt(sd1)
"Sum=";sum
"mean=";mean
"standard deviation=";d
_EOT_
In bc references to bc variables are just var
While $var is the reference of a shell variable. The unquoted here document allows $-substitution.
@Sneha And to answer exactly "Why" from original post - this is because expr by default/design works with integers only, everything after (and including) the decimal point is simply truncated.