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
Describe how serial data access finds data
jeyben [28]

Answer:

Serial data access will go through all the data by order until the target data is reached

Explanation:

This is opposite of direct data access which immediately finds the desired

data

4 0
3 years ago
Read 2 more answers
Brake fluid is made up of a chemical that:
TEA [102]

A) IS MOSTLY JUST ENGINE Oil.

7 0
3 years ago
Read 2 more answers
In ________- key encryption, two keys, known as a key pair, are created, where one key is used for coding and the other key for
Pavel [41]
In Encryption - ........
7 0
3 years ago
What is the maximum number of characters you can have in a file name​
Leokris [45]

Answer:

255 number of characters including space, \ etc.

5 0
3 years ago
Double[][] vals = {{1.1, 1.3, 1.5},
Elis [28]

Answer:

Option 3 i.e., 7.3 is the correct answer to the following question.

Explanation:

In the following two dimensional array that is the double data type 2-D array variable "val" and it contains some float type information in the form of matrix that has 4 rows and 3 columns, In the following statement, they asked the value of 4th row and 2nd column and in the matrix 4th row and 2nd column contain the value i.e., 7.3.

3 0
3 years ago
Other questions:
  • You are testing a web application for sql injection vulnerabilities. you send various sql statements which return results on the
    5·1 answer
  • In order to average together values that match two different conditions in different ranges, an Excel user should use the functi
    6·1 answer
  • Extinction of a species is always a negative impact on the Earth.<br><br> True<br> False
    8·1 answer
  • software that provides capabilities common across all organizations and industries is known as ________ software.
    15·2 answers
  • Define function print_popcorn_time() with parameter bag_ounces. If bag_ounces is less than 3, print "Too small". If greater than
    14·2 answers
  • Who invented the speaker?
    14·2 answers
  • To save time and avoid formatting errors, you can use the ____ to apply custom formatting to other places in your presentation q
    9·1 answer
  • Using a conversation voice is part of:
    9·1 answer
  • Which solution eliminates the need for dedicated high-speed WAN connections between sites
    5·1 answer
  • Maria is conducting a security investigation and has identified a suspect. The suspect is an employee of the organization who ha
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!