You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
269 B
19 lines
269 B
2 months ago
|
#! /usr/bin/bash
|
||
|
# File: return-value-return.sh
|
||
|
|
||
|
|
||
|
function square() {
|
||
|
|
||
|
return $(( ${1} * ${1} ))
|
||
|
}
|
||
|
|
||
|
|
||
|
square "2"
|
||
|
echo "Quadrat von 2 ist ${?}"
|
||
|
square "4"
|
||
|
echo "Quadrat von 4 ist ${?}"
|
||
|
square "3"
|
||
|
echo "Quadrat von 3 ist ${?}"
|
||
|
square "32"
|
||
|
echo "Quadrat von 32 ist ${?}"
|