Course Hive
Search

Welcome

Sign in or create your account

Continue with Google
or
Unix/Linux Tutorials | The Comparison of Two Integer Numbers | by Durga Sir
Play lesson

Unix/Linux Tutorial Videos - Unix/Linux Tutorials | The Comparison of Two Integer Numbers | by Durga Sir

5.0 (2)
28 learners

What you'll learn

This course includes

  • 44.5 hours of video
  • Certificate of completion
  • Access on mobile and TV

Summary

Keywords

Full Transcript

The Comparison of Two Integer Numbers ================================== Write a script to compare the given two integer numbers. It has to print the following messages based on comparison. 1. The given two numbers are equal. 2. First Number is greater than Second Number. 3. First Number is less than second Number. #! /bin/bash read -p "Enter First Number:" a read -p "Enter Second Number:" b if [ $a -eq $b ] then echo "Both Numbers are equal" elif [ $a -gt $b ] then echo "First Number is Greater than Second Number" else echo "First Number is Smaller than Second Number" fi durgasoft@durgasoft:~/scripts$ ./test.sh Enter First Number:10 Enter Second Number:10 Both Numbers are equal durgasoft@durgasoft:~/scripts$ ./test.sh Enter First Number:10 Enter Second Number:20 First Number is Smaller than Second Number durgasoft@durgasoft:~/scripts$ ./test.sh Enter First Number:20 Enter Second Number:10 First Number is Greater than Second Number

Course Hive

Continue this lesson in the app

Install CourseHive on Android or iOS to keep learning while you move.

Related Courses

FAQs

Course Hive
Download CourseHive
Keep learning anywhere