Skip to content

Latest commit

 

History

History
11 lines (6 loc) · 940 Bytes

File metadata and controls

11 lines (6 loc) · 940 Bytes

Exercise 2 - Performing basic mathematical calculations and numerical logical comparisons

In this exercise, you'll be crafting a Bash script to conduct fundamental arithmetic operations on two integers inputted by the user. Additionally, you'll utilize logical comparisons to discern which operation yields the highest result.

2.1 Create a Bash script

Develop a Bash script that is executable, prompting users for two integers. Subsequently, store and display both the sum and product of the provided integers. Employ the 'echo' and 'read' commands similar to previous exercises, and remember the syntax for arithmetic calculations.

2.2 Add logic to your script

Enhance your script by incorporating logic to evaluate whether the sum exceeds, falls short of, or equals the product. Accompany each potential outcome with an appropriate statement. Remember to utilize a conditional block and the syntax for logical operators.