Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- clear
- bilanganpertama=0
- bilangankedua=1
- total=0
- echo "M. Iqbal Suhardimas ( 2018 804 302 ) | Soal No. 2 | Page 4 | UTS ";
- echo;
- read -p "Masukan batas deret Fibbonaci? " angka;
- for (( i=0; i<$angka; i++ ))
- do
- hasil=$((bilanganpertama + bilangankedua))
- if [[ "$i" -ge "$angka-1" ]]
- then
- operator="="
- total=$hasil
- echo -n "$bilanganpertama$operator$total";
- else
- operator="+"
- echo -n "$bilanganpertama$operator";
- bilanganpertama=$bilangankedua
- bilangankedua=$hasil
- fi
- done
- echo;
- echo "Jumlah Deret adalah $total";
- echo;
- echo "UTS No.2 : https://pastebin.com/7Ty9VXeH";
- echo "UTS No.3 : https://pastebin.com/tvuXgZA8";
- echo "Tugas Harian No.4 : https://pastebin.com/q55XucAA";
- echo "Tugas Harian No.5 : https://pastebin.com/DQTrSek8";
Add Comment
Please, Sign In to add comment