Loading…
OS · First scripts · Program 01 · In the record
Write a shell script to add the two numbers
1#!/bin/bash2 3echo "Enter the first number:"4read a5 6echo "Enter the second number:"7read b8 9sum=$((a + b))10 11echo "Sum of $a and $b = $sum"12 ⏎ 8Enter the first number: 12 Enter the second number: 8 Sum of 12 and 8 = 20
Run program 01 in your browser
bash · just-bash. Change the code or the input, run it, break it, and see what happens.