1.below is my code for shell script using gitbash l want it to produce an output like: 2→→1x2 6→→2x3 12→→3x4 20→→4x5 30→→5x6 and that when the number is divisible by 5 it mentions it  #reading the input number from user read -p "Enter number: " number #setting count to 0, to hold total of this kind of numbers count=0 #loop till less than or equal to the user entere nunber for (( i=1;i<=$number;i++ )) do #this loop is to find the factors of the numbers from 1 to user given numbers for ((j=1;j<=i;j++)) do #checking for the factor of the number by checking if the number #is divisble or not if [ `expr $i % $j` -eq 0 ] then #if we found factor of the number, then check if the division of the #present factor with the number is equal to factor+1, i.e for example # take 12, lets say the factor of 12 is 3, so if 12/3 == 3+1 then we can say # that this number can be formed by multiplying two successer numbers 3 and 4 which 12 if [ `expr $i / $j` -eq `expr $j + 1` ] then #printing the number echo $i #counting the numbers count=`expr $count + 1`; fi fi done done #printing the count echo "The total numbers are: "$count

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%

1.below is my code for shell script using gitbash l want it to produce an output like:

2→→1x2

6→→2x3

12→→3x4

20→→4x5

30→→5x6

and that when the number is divisible by 5 it mentions it 

#reading the input number from user

read -p "Enter number: " number

#setting count to 0, to hold total of this kind of numbers

count=0

#loop till less than or equal to the user entere nunber

for (( i=1;i<=$number;i++ ))

do

#this loop is to find the factors of the numbers from 1 to user given numbers

for ((j=1;j<=i;j++))

do

#checking for the factor of the number by checking if the number

#is divisble or not

if [ `expr $i % $j` -eq 0 ]

then

#if we found factor of the number, then check if the division of the

#present factor with the number is equal to factor+1, i.e for example

# take 12, lets say the factor of 12 is 3, so if 12/3 == 3+1 then we can say

# that this number can be formed by multiplying two successer numbers 3 and 4 which 12

if [ `expr $i / $j` -eq `expr $j + 1` ]

then

#printing the number

echo $i

#counting the numbers

count=`expr $count + 1`;

fi

fi

done

done

#printing the count

echo "The total numbers are: "$count

O MINGW64:/c/Users/tafad
GNU nano 5.9
#reading the input number from user
task3
read -p "Enter number: " number
#setting count to 0, to hold total of this kind of numbers
count=0
#loop till less than or equal to the user entere nunber
for (( i=1;i<=$number;i++ ))
do
#this loop is to find the factors of the numbers from 1 to user given numbers
for ((j=1;j<=i;j++))
do
#checking for the factor of the number by checking if the number
#is divisble or not
if [ `expr $i % $j` -eq 0 ]
then
#if we found factor of the number, then check if the division of the
#present factor with the number is equal to factor+l, i.e for example
# take 12, lets say the factor of 12 is 3, so if 12/3 == 3+1 then we can say
# that this number can be formed by multiplying two successer numbers 3 and 4 which 12
if [ `expr $i / $j` -eq `expr $j + 1° ]
then
#printing the number
echo $i
#counting the numbers
count=`expr $count + 1`;
fi
fi
done
done
#printing the count
AG Help
лх Exit
AO Write Out
AR Read File
AC Location
^/ Go To Line
Read 94 lines
M-U Undo
M-E Redo
M-] To Bracket
AQ where Was
ЛВ Вack
AF Forward
AW Where Is
M-A Set Mark
M-6 Сору
Ae Prev Word
A. Next Word
AK Cut
AT Execute
M-Q Previous
1\ Replace
AU Paste
AJ Justify
M-W Next
Transcribed Image Text:O MINGW64:/c/Users/tafad GNU nano 5.9 #reading the input number from user task3 read -p "Enter number: " number #setting count to 0, to hold total of this kind of numbers count=0 #loop till less than or equal to the user entere nunber for (( i=1;i<=$number;i++ )) do #this loop is to find the factors of the numbers from 1 to user given numbers for ((j=1;j<=i;j++)) do #checking for the factor of the number by checking if the number #is divisble or not if [ `expr $i % $j` -eq 0 ] then #if we found factor of the number, then check if the division of the #present factor with the number is equal to factor+l, i.e for example # take 12, lets say the factor of 12 is 3, so if 12/3 == 3+1 then we can say # that this number can be formed by multiplying two successer numbers 3 and 4 which 12 if [ `expr $i / $j` -eq `expr $j + 1° ] then #printing the number echo $i #counting the numbers count=`expr $count + 1`; fi fi done done #printing the count AG Help лх Exit AO Write Out AR Read File AC Location ^/ Go To Line Read 94 lines M-U Undo M-E Redo M-] To Bracket AQ where Was ЛВ Вack AF Forward AW Where Is M-A Set Mark M-6 Сору Ae Prev Word A. Next Word AK Cut AT Execute M-Q Previous 1\ Replace AU Paste AJ Justify M-W Next
O MINGW64:/c/Users/tafad
tafad@MARISA MINGW64 ~
$ nano task3
tafad@MARISA MINGW64 ~
$ ./task3
Enter number: 30
2
6
12
20
30
The total numbers are: 5
tafad@MARISA MINGW64
$ nano task3
Transcribed Image Text:O MINGW64:/c/Users/tafad tafad@MARISA MINGW64 ~ $ nano task3 tafad@MARISA MINGW64 ~ $ ./task3 Enter number: 30 2 6 12 20 30 The total numbers are: 5 tafad@MARISA MINGW64 $ nano task3
Expert Solution
steps

Step by step

Solved in 4 steps with 5 images

Blurred answer
Knowledge Booster
Linux
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education