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
Anarel [89]
4 years ago
8

Give a recursive (or non-recursive) algorithm to compute the product of two positive integers, m and n, using only addition and

subtraction ?
Computers and Technology
1 answer:
LiRa [457]4 years ago
6 0

Answer:

Multiply(m,n)

1. Initialize product=0.

2. for i=1 to n

3.      product = product +m.

4. Output product.

Explanation:

Here we take the variable "product" to store the result m×n. And in this algorithm we find m×n by adding m, n times.

You might be interested in
When 2 or more computers are connected it is called?
Alenkasestr [34]

When two or more computers are connected it is called Local Area Network (LAN).

5 0
3 years ago
In mathematics, the notation n! represents the factorial of the nonnegative integer n. The factorial of n is the product of all
hram777 [196]

Answer:

The program to this question can be given as:

Program:

factorial=1 #declare a variable.  

number=int(input("Enter a positive integer:")) #input a number.  

while (number>0): #loop  

   factorial= factorial*number # holding value in factorial variable  

   number=number-1  

print('=',factorial) #print value.

Output:

Enter a positive integer:6  

= 720  

Explanation:

The description of the above python program can be given as:

  • In the above program firstly we define a variable that is "factorial". In this variable, we assign a value that is 1 and it is used to calculate the factorial value.  
  • We define a variable "number". The number variable is used to take input from the user.  
  • Then we define a loop in the loop we calculate the factorial and hold the value in the factorial value in the last we print the value.  

4 0
3 years ago
Why is storage and important part of the computing process? It must be atleast five sentences.
worty [1.4K]

Your computer needs storage because the processor needs a place to perform its magic — a scratchpad for mad doodles, if you will. All computers need storage. ... Memory is where the processor does its work, where programs run, and where information is stored while it's being worked on.

And why five sentences?

3 0
3 years ago
The ____ keyword specifies that a function or method does not return a value.
dedylja [7]
The void keyword. Otherwise you use a type name, such as int or char or string.
4 0
3 years ago
Which of the following is a benefit, as well as a risk, associated with client/server networks?
melomori [17]
A. IT professional, who maintains the network, must be added and removed from the network. - risk 
B. Clients work independently; therefore, if one computer is not working, other computers can still do their jobs.  - benefit (scalability is always a benefit)
C. Security levels are set up by individuals; therefore, these networks may not be as secure. - risk
D. There is no need for a big IT department to keep the network up and running. - benefit (it is simple for maintenance)
7 0
4 years ago
Read 2 more answers
Other questions:
  • James was having coffee and overhead a conversation between two men who talked about the fact that their friend could not find a
    10·1 answer
  • HELP ASAP!!!! PLEASE !!! What information does the Media Access Control (MAC) on a network card provide?
    9·2 answers
  • Prompt the user to input an integer, a double, a character, and a string, storing each into separate variables. Then, output tho
    9·1 answer
  • Binary data is written in hexadecimal. For example, when creating a graphic for a website, colors are represented by six hexadec
    12·1 answer
  • Which one of the following is an example of hacktivism according to you and why?
    11·1 answer
  • A(n) ____ is a logical grouping of several data files that store data with similar characteristics.
    8·1 answer
  • Let f be the following function: int f(char *s, char *t){char *p1, *p2;for(p1 = s, p2 = t; *p1 != ‘\0’&& *p2 != ‘\0’; p1
    6·1 answer
  • Please Complete in Java a. Create a class named Book that has 5 fields variables: a stock number, author, title, price, and numb
    10·1 answer
  • 5
    8·2 answers
  • A penetration tester is experimenting with Network Mapper (Nmap) on a test network as a privileged user. The tester would like t
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!