Skip to main content
1 of 3
user avatar
user avatar

#AWK — 84 characters

awk '{printf("The hypotenuse of this right triangle is %.3f\n",sqrt($1*$1+$2*$2))}'

e.g.

$ echo 3 4 | awk '{printf("The hypotenuse of this right triangle is %.3f\n",sqrt($1*$1+$2*$2))}'
The hypotenuse of this right triangle is 5.000
user15259