Sum Of Two Numbers
- Explanation
- Input
read Num1
read Num2
- Sum
Sum=$(($Num1 + $Num2)) OR Sum=`expr $Num1 + $Num2`
- Output
echo "Sum Of Two Numbers=$Sum"
- Example Code
#!/bin/bash echo "Enter the first Number" echo "Enter the second Number" |
- Result
Input :
10 20
Output :
Sum Of Two Number : 30
- Note
For Any Query Comment in box given Below.
Sum Of Two Numbers in Shell/Bash Programming
Reviewed by CodexRitik
on
November 15, 2020
Rating:
No comments: