Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions 02-add_nums.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/bin/sh

echo "Enter your first number"
read first
echo "Enter your second number"
Expand All @@ -13,3 +11,12 @@ echo "The sum is $sum"

# exercise: ask the user for the width and height and present total
# number of pixels

read -p "Enter width: " width
read -p "Enter height: " height

# Calculate total pixels
total=$((width + height))

# Show the result
echo "Total number of pixels: $total"
Binary file added 2-Branches-Screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added After merge.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.