hey there...could I please ask for some help for my programming assignment. I having a problem in assigning values to a variables inside a function. I don't know what im doing wrong...any suggestions could be a great help..here is my code
a = 0
myfunc(){
echo $1 "Computation"
a = `expr 3.14\* $2\*$2|bc`
echo a
}
myfunc $1 $2
What I would like to do is to enter a command line argument. the first is a string and the second is a integer. the function should compute for the are of a circle but whenever I echo the value of a a error occurs..could I please ask for some clarifications on what Im doing wrong...thanks
If my arguments are Circle 2
The proper output of the program should be:
Circle Computation
12.56