1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Sedaia [141]
3 years ago
6

Write a bash script HW4p2.sh to print out the list of numbers between 0 to 100 (including 0 and 100) that are divisible by both

3 and 5. You must create a bash function inside the script to check the divisibility by 3 and 5.
Computers and Technology
1 answer:
ratelena [41]3 years ago
8 0

Answer:

#!/bin/bash

function number_div( ) {

   for i in {0. .100};

   do

   if (( $i % 3 == 0 ))

   then

   echo $i

   elif (( $i % 5 == 0 ))

   then

   echo $i

   else

   echo "Number not divisible by 3 and 5"

   fi;

   done

}

number_div( )

Explanation:

The bash script is saved as "HW4p2.sh" and executed as "./HW4p2.sh". This code would print all and only numbers divisible by 3 or 5.

You might be interested in
A portable electronic device that can be used in an emergency to stop someone’s heart from going out of rhythm is called a/an
JulsSmile [24]
It is called a Heart pace maker
7 0
3 years ago
Read 2 more answers
What would the range(3, 9) function generate?
gregori [183]

Answer:

A, 3,6,9

is the answer

Explanation:

bc it count by

3 0
3 years ago
Why is it important to install updates? Why should you use the Power button on the Start menu instead of the Power button on you
IrinaK [193]

Answer:

Software updates do a lot of things. Software updates offer plenty of benefits. ...

Updates help patch security flaws. Hackers love security flaws, also known as software vulnerabilities. ...

Software updates help protect your data. ...

It’s not all about you. ...

You deserve the latest and greatest

Explanation:

hope that worked

3 0
3 years ago
In addition to offering word excel PowerPoint and one note the office home and business edition also offers
algol13

Answer:

Dropbox?

Explanation:

8 0
3 years ago
Which form of media allows the audience to share in and comment on the content immediatly
Luba_88 [7]

twitter

they will allow you to share comments about any topic you want

4 0
3 years ago
Other questions:
  • It is not recommended by the USA EPA, but adding refrigerant to a leaking A/C system is
    13·1 answer
  • Given the following code, what is output by the method call, mystery(6 * 8)?
    8·1 answer
  • Image files are grouped into two categories: _____.
    5·1 answer
  • What are all the folders located on the DOCK called?
    11·1 answer
  • I am trying to write a c++ program like the game typeracer. When the player starts the program he will be asked to write a sente
    5·1 answer
  • So can u please follow my new ig acc i just started it yesterday its called stunnerspamz
    5·2 answers
  • In the writing and language test of the SAT, questions ask students to do which of the following? A. Write an essay B. Define a
    14·2 answers
  • How to simplify???? 2(-3x^2+6x+1)-2(4x^2-3x+1)<br><br>​
    7·1 answer
  • 1)When the liquid is spun rapidly, the denser particles are forced to the bottom and the lighter particles stay at the top. This
    10·1 answer
  • Choose the term that matches each description.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!