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
In this lab you will learn about the concept of Normal Forms for refining your database design. You will then apply the normaliz
noname [10]

Answer:

I don't know

Explanation:

is about knowing how to make use of the refinery

7 0
3 years ago
If, after fetching a value from memory, we discover that the system has returned only half of the bits that we expected; it is l
Ratling [72]

Answer:

Option c (byte alignment) is the appropriate alternative.

Explanation:

  • This same alignment problem emerges if another architecture does seem to be an application-specific byte, however, the design phrase set education seems to be greater within one byte. In these kinds of case scenarios, because when recovering a significance from people's memories the structure can come back less than half including its bits.
  • If memory access isn't synchronized, it seems to have been unevenly spaced. Recognize that even by interpretation, byte storage access has always been connected.

Some other choices aren't connected to the type of situation in question. So the above is the right option.

4 0
3 years ago
Prewritten, commercially available sets of software programs that eliminate the need for a firm to write its own software progra
Dovator [93]

Answer:

Software packages.

Explanation:

Prewritten, commonly available software programs that has been applied here as software packages which completely remove the requirement of the organization to compose the own computer programs for all of these functionalities.

Software package is one of the collection of the program inside which the user get all useful applications or software as well as software module that meet their requirements.

6 0
4 years ago
Jim has just installed two new SAS SSDs in his system. He properly installs the hardware in his machine. Before he can use them
stiv31 [10]

Answer:

  • Use the fdisk command to create one or more partitions on each of the hard disk drives.
  • Mount any partitions created on the two hard drives such that they are accessible by the operating system.
  • Format any partitions created with a valid file system recognized by Linux.

Explanation:

8 0
3 years ago
HELP ASAP PLEASE!!!
MrMuchimi

Answer:

Click and drag the mouse to select the cells

Explanation:

5 0
3 years ago
Other questions:
  • Which of the following sentences is written in the active voice
    12·2 answers
  • If you have a database with birthdates, and you would like to find everyone who was born before June 16, 1967, what would you en
    15·2 answers
  • Which element of the word program window contains buttons for saving a document and for undoing, redoing, and repeating a change
    5·1 answer
  • Write a C# program named InchesToCentimeters that declares a named constant that holds the number of centimeters in an inch: 2.5
    14·1 answer
  • When using a public computer or network, you should always _______. A. install a firewall. B. run an anti-virus program beforeha
    11·2 answers
  • Memory, as a general construct, is best defined as A) the ability to briefly retain information in the senses. B) the long-term
    12·2 answers
  • Assume that month is an int variable whose value is 1 or 2 or 3 or 5 ... or 11 or 12. Write an expression whose value is "jan" o
    10·1 answer
  • If $350 is the profit of an initial investment of $1000.00, what is the percentage profit?​
    11·2 answers
  • Question # 2
    6·1 answer
  • How does the technology affect you daily living? Give situations where you use technology and how it helped you.​
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!