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
gavmur [86]
3 years ago
10

The following program results in a compiler error. Why? int FindMin(int a, int b) { int min; if (a < b) { min = a; } else { m

in = b; } return min; } int main() { int x; int y; cin >> x; cin >> y; min = FindMin(x,y); cout << "The smaller number is: " << min << endl; return 0; }
Computers and Technology
1 answer:
Mila [183]3 years ago
7 0

Answer:

The answer is "Variable min is defined in the "FindMin()" method, but is used in the main method".

Explanation:

Following are the correct code to the given question:

#include <iostream>//header file

using namespace std;

int FindMin(int a, int b) //defining a method FindMin that takes two integer parameters

{

   int min; //defining integer variable

   if (a < b) //use if to check a value less than b

   {

       min = a; //holding smallest value in min

   }

   else //defining else block

   {

       min = b;//holding smallest value in min

   }

   return min; //return min value

}

int main() //defining main method

{

   int x,y,min; //defining integer variable

   cin >> x; //input value

   cin >> y; //input value

   min = FindMin(x,y); //holding method return value in min variable

   cout<<"The smaller number is: "<<min<< endl; //print method value with message

   return 0;

}

Output:

Please find the attached file.

In the code, a method "FindMin" is defined that takes two integer parameters "a,b" and inside the method, an integer variable "min" is declared that uses a conditional statement that checks the smallest value that store in the min variable and return its value.

In the main method, three integer variable is declared in which two is used for hold value from user-end pass into the method and store its return value in min variable and print value with the message.

You might be interested in
TRUE/FALSE QUESTIONS: T F 1. An intruder can also be referred to as a hacker or cracker. T F 2. Activists are either individuals
Law Incorporation [45]

Answer:

1. True 2. False 3. True 4. True 5. True 6. False 7. True

Explanation:

1.  A hacker/cracker finds and exploits weakness in order to gain access with a criminal intent, just as an intruder.

2. Activists are people who campaign to bring about a positive political or social change.

3. It is illegal to use a device as a packet sniffer to steal people's usernames and passwords.

4. This quite true, as there is a huge community of hackers where people are highly recognized for hacking.

5. Yes, intruders have a common attack methodology.

6. IDS monitors networks or systems to identify suspicious activities while a user interface is the means the computer and the user interacts. So it's false.

7. instrusion detection involves monitoring networks or systems to identify suspicious activities, so an intruder is detected if their behavior is suspicious when compared to a legitimate user.

5 0
3 years ago
For what purpose do the hackers create the zombies army?
enyata [817]

Answer:

A. DDoS Attacks

Explanation:

A zombie, in computer terminology, is a hacker, computer worm, trojan horse, or virus compromised internet connected computer, which can be remotely directed to perform malicious tasks

E-mail spams and denial-of-service, DoS attacks are spread and launched by botnets of zombie computers

Botnets which are also known as "zombie army", are used by hackers mainly for spam and distributed-denial-of-service, DDoS, attacks

While a DoS attack involves one machine, while a DDoS attack consist of multiple computing devices and machines

A botherder is the originator of a botnet and common botnets include Mr Black. Pushdo, and cyclone

5 0
3 years ago
Which of the following detects unauthorized user activities, attacks, and network compromises, alerts of the detected attacks, a
Anit [1.1K]

The answer is IPS (Intrusion Prevention Systems)

The Intrusion Prevention Systems and Intrusion Detection Systems (IDS) are two security technologies that secure networks and are very similar in how they work. The IDS detects unauthorized user activities, attacks, and network compromises, and also alerts. The IPS, on the other hand, as mentioned, is very similar to the IDS, except that in addition to detecting and alerting, it can also takes action to prevent breaches.


3 0
3 years ago
Edmund wants to create a website for his company. He has created all the necessary content and now wants to style and format the
saw5 [17]

CSS, or Cascading Style Sheets, will allow him to manipulate the looks.

8 0
4 years ago
Read 2 more answers
What are some areas to fill out in the New Formatting Rule dialog box? Check all that apply. rule type function name condition c
spayn [35]

Answer:

The answer to this question is given below in the explanation section.

Explanation:

In this question the given options are:

  1. rule type
  2. function name
  3. condition
  4. cell reference
  5. argument
  6. format

<u>The correct options to this question are:</u>

1. rule type  

3. condition

6.  format

These are the areas that can be used to fill out in the New Formatting Rule dialog box. Other options are not correct becuase these are not used to fill out new formatting rule dialog box.

6 0
3 years ago
Read 2 more answers
Other questions:
  • Consider this scenario: A major government agency experiences a data breach. As a result, more than 100,000 personal records are
    7·2 answers
  • Type the correct answer in the box. Spell all words correctly.
    13·1 answer
  • A network consists of 10 computers, all running windows 7 professional. one computer acts as a file server and serves up data to
    6·1 answer
  • Write a function call it isEvenPositiveInt which takes an integer x and return true if x is positive and also even. Note isinsta
    10·1 answer
  • Rob used Track Changes to suggest changes in Jack's document. Jack agrees with some edits and disagrees with others. What should
    14·1 answer
  • What is a difference between a waxing crescent and a waning gibbous? (1 point) waxing crescent: first quarter waning gibbous: th
    11·1 answer
  • Window is a very popular operating system becouse of its _ environment .​
    14·2 answers
  • Write one for loop to print out each element of the list several things. then write another for loop
    5·1 answer
  • Which option is the correct format of placing HTML tags while coding in HTML?
    13·2 answers
  • Which of the following terms refers to the cells that contain values and labels to be graphed in the chart?.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!