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
Owen is writing a program that will lock his computer for one hour if the incorrect password is entered more than five times. Ha
kiruha [24]

Answer:

Your answer is <em>I think </em>A) A loop

Explanation:

In computer programming, a loop is a sequence of instruction s that is continually repeated until a certain condition is reached.

5 0
3 years ago
The minimum spanning tree of an undirected graph G exists if and only if G is connected. True or False?
zlopas [31]

Answer: True

Explanation:

The definition of minimum spanning tree(MST) says that the graph must be connected and undirected to be considered for MST. It has (V-1) edges where V is the number of vertices. The minimum spanning tree is implemented using Kruskal's algorithm whereby it starts by considering the minimum weighted edge and covers all the edges upto (V-1) edges. So for MST it has to be connected

3 0
3 years ago
Mechanisms that combine memory, processing speed, and knowledge to regulate the analysis and flow of information within the info
gizmo_the_mogwai [7]

Answer:

control processes.

Explanation:

Mechanisms that combine memory, processing speed, and knowledge to regulate the analysis and flow of information within the information-processing system are referred to as executive/control processes.

3 0
3 years ago
Which of the following shows data conversion taking place?
PSYCHO15rus [73]

Answer:

C

data converted from double to integer.

7 0
2 years ago
A laptop gets replaced if there's a hardware issue. Which stage of the hardware lifecycle does this scenario belong to?
Ilya [14]

Answer: Maintenance. This is the stage where software is updated and hardware issues are fixed if and when they occur. Retirement. In this final stage, hardware becomes unusable or no longer needed and it needs to be properly removed from the fleet

Explanation:

3 0
3 years ago
Other questions:
  • What fields of engineering are in Biomedical
    7·1 answer
  • The standing toe touch is most likely to result in
    15·1 answer
  • In a linked chain implementation of a queue, the performance of the enqueue operation
    10·1 answer
  • The famous study entitled ""Protection Analysis: Final Report"" focused on a project undertaken by ARPA to understand and detect
    14·1 answer
  • Which two tasks are associated with router hardening? (choose two.)?
    6·1 answer
  • The study of a current business and information system application and the definition of user requirements and priorities for a
    5·1 answer
  • The inFS.open(str) function has a string parameter str that specifies the _____ of the file to open.
    10·1 answer
  • 3. The following is a dump of a UDP header in hexadecimal format. 0045DF000058FE20 a. What is the source port number? b. What is
    15·1 answer
  • What are 2 ways computers can connect to a network?
    5·1 answer
  • Why would you browse by entering a URL rather than use a link in a Web page
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!