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
Lerok [7]
3 years ago
15

Can you right the C++ of this algorithm? Inizio = Start, Fine= End. THANK YOU SO MUCH!!

Computers and Technology
1 answer:
posledela3 years ago
4 0
<span>#include <iostream> using namespace std; bool bears(int n); int main(){ int number; do{ cout<<"enter the amount of bears (press 0 to stop the program): "; cin>>number; if (bears(number)){ cout<<"you have reached the goal!"<<endl; } else{ cout<<"sorry, you have not reached the goal."<<endl; } }while(number != 0); } bool bears(int n){ if (n < 42){ return false; } else if (n == 42){ return true; } else{ if (n % 5 == 0){ return bears(n - 42); } else if(n % 2 == 0){ return bears(n / 2); } else if(n % 4 == 0|| n % 3 == 0) { int one; int two; one=n%10; two=(n%100)/10; return bears(n - one * two); } } <span>}</span></span>
You might be interested in
Which attributes are indicators that a website is reliable? Check all that apply is up to date explains sources of data is an ed
Ahat [919]

Answer:

1 - Is up to date

2 - explains sources of data

3 - is an educational website

6 - will not share personal information

7 - has articles written by experts

7 0
3 years ago
There are _______ bits to every byte.
MrMuchimi

8. according to Google, 1 byte = 8 bits

7 0
3 years ago
Read 2 more answers
How do i cancel my brainly premium account?
Vikki [24]

Answer:

press cancel

Explanation:

5 0
3 years ago
Read 2 more answers
Describe how to find out a file type by using your Computer.
user100 [1]

First you go to the 3 dots neer the x you pres it thin you go to downloads and it shod be ther i hop i help if so make me the branliy

8 0
3 years ago
Read 2 more answers
3 Characteristics of Newton’s law’s.
polet [3.4K]

Answer:

In the first law, an object will not change its motion unless a force acts on it. In the second law, the force on an object is equal to its mass times its acceleration. In the third law, when two objects interact, they apply forces to each other of equal magnitude and opposite direction.

Explanation:

4 0
3 years ago
Other questions:
  • Solve system of equations. <br>x+2y-z=4<br>2x-y+3z=8 <br>-2x+3y-2z=10
    12·1 answer
  • The sequence of folders to a file or folder is called a(n) ________
    8·1 answer
  • Ng/ Computer Applications - Office 2016 - EL3520 A
    13·1 answer
  • Find the Nearest Repeated Entries in an Array People do not like reading text in which a word is used multiple times in a short
    15·1 answer
  • Write the correct statements for the above logic and syntax errors in program below.
    12·1 answer
  • Alexa it is olewi.............................................
    15·2 answers
  • What is a personal data?
    12·1 answer
  • Which quality should an experiment have to be replicable and valid? O clearly detailed results O a well-cited research paper O s
    7·1 answer
  • Are there any Potential Dangers in Artificial Intelligence?
    11·2 answers
  • Checking for and correcting errors may need to be done numerous during which of the following phases of the software development
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!