
Concept explainers
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](https://content.bartleby.com/qna-images/question/5a6269b1-0372-40d6-bdde-74e9eb6c7cd9/39adddc7-fe41-4479-919f-6a885e94e2bd/c1ixz7r_thumbnail.png)


Step by stepSolved in 4 steps with 5 images

- Shell Scripting: Write the output when the input is 40: echo -n "Enter any number:" read n if [ $n -eq 30 ] 11 [ $n -gt 50 ] then echo "1" else echo "2" fiarrow_forwardHello I am trying to get def automated(filename): to read an imported text document and have have it make a playlist based upon the specified genre and playlist time. Example is if you decide upon 20 minutes and blues as a genre, the program randomly chooses songs that total up to 20 minutes as close as possible. There is no sample output as def automated isn't set up and configured yet. For this python program you have to choose a file to open first then run automated song choice. Automated is the one I am trying to get working def automated(filename): try: print(filename) except FileNotFoundError: print('Document not found.')def main(): filename = '' import case print("\n\tPlaylist Manager") print('-'*45) print('\tWhich Program do you want to run?') choice = '' while choice.upper() !='Q': print() print('current file opened:', filename) print('0) choose a file to open') print('1) automated song choice')…arrow_forwardA string of readings is stored in memory locations starting at XX70 H, and the end of the string is indicated by the byte OD H. Write a program to check each byte in the string, and save the bytes in the range of 30H to 39H (both inclusive) in memory locations starting at XX90 H. Also store the number of bytes saved in the memory location at 6090 H.arrow_forward
- Command line arguments are passed to int main(int argc, char** argv) as arguments argc and argv. You should assume that argc is at ebp+8 and argv is at ebp+12. 00000000 <what>: 0: push %ebp 1: mov %esp,%ebp 3: sub $0x10,%esp 6: mov 0x8(%ebp),%eax 9: add $0x4,%eax c: mov %eax,-0x4(%ebp) f: mov 0x8(%ebp),%eax 12: imul 0xc(%ebp),%eax 16: mov %eax,-0x8(%ebp) 19: mov 0x8(%ebp),%eax 1c: sub 0xc(%ebp),%eax 1f: mov %eax,-0xc(%ebp) 22: mov -0x4(%ebp),%edx 25: mov -0x8(%ebp),%eax 28: add %eax,%edx 2a: mov -0xc(%ebp),%eax 2d: add %edx,%eax 2f: leave 30: ret00000031 <main>: 31: lea 0x4(%esp),%ecx 35: and $0xfffffff0,%esp 38: pushl -0x4(%ecx) 3b: push %ebp 3c: mov %esp,%ebp 3e: push %ebx 3f: push %ecx 40: sub $0x10,%esp 43: mov %ecx,%ebx 45: mov 0x4(%ebx),%eax 48: add $0x4,%eax 4b: mov (%eax),%eax 4d: sub…arrow_forwardWrite a program that converts U.S. Dollar Amounts to different Cryptocurrencies by multiplying US Dollar amounts times conversion factors stored in named constants. Ask the user to enter the amount of money in U.S. Currency, then display the output of the conversions to the different cryptocurrencies listed below. The following conversion rates must be stored as named constants: 1 US Dollar = 0.00002306 Bitcoin (BTC)1 1 US Dollar = 0.01122814 Ethereum Classic (ETC)1 1 US Dollar = 2.07961078 Dogecoin (DOGE)1 1 US Dollar = 0.48910811 Cardano (ADA)1 Format your currency amounts in fixed point notation with two decimal places of precision, and be sure that the decimal point is always displayed.arrow_forwardNEED HELP WITH PYTHON CODE. ALSO, PLEASE PROVIDE DETAILS SEPARATELY ON HOW AND WHAT DID U USE TO GET UR CODE DONE.arrow_forward
- Hello. Please answer the attached MIPS programming question correctly by converting the given C code to MIPS. Please do not use very advanced syntax to solve the problem and do not use ".globl main" in your code. *If correctly convert the code and do not use very advanced syntax, I will give you a thumbs up. Thanks.arrow_forwardWhat is the decimal value of register SO after executing the following code? Consider that the value of variable g = 8 and variable h = 3. data g_var: .word 8 h var: .word 3 text lw $s1, g_var lw $s2, h var sub $50, $s2, $slarrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education





