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
zimovet [89]
3 years ago
12

Write a program that defines anduses macro MINIMUM2to determine the smallest of two numeric values. Input the valuesfrom the key

board.
Computers and Technology
1 answer:
lisov135 [29]3 years ago
3 0

Answer:

#include<iostream>

#define MINIMUM2(s1,s2) ((s1<s2?s1:s2))

using namespace std;

int main(){

   //initialization

  int s1,s2;

  //display the message

   cout<<"Enter the number 1: "<<endl;

   cin>>s1;  //read the input

   cout<<"Enter the number 2: "<<endl;

   cin>>s2; //read the input

   //use micros

   int min_Value = MINIMUM2(s1,s2);

   //display

   cout<<"The minimum value is: "<<min_Value<<endl;

    return 0;

}

Explanation:

Micros is the constants of symbols, values, etc.

it is used with the preprocessor directives represented by '#'. it means, the program process the information first before compiling the code.

syntax:

#define macro_name replacement_information

it actually, replace the information written in the macros into the code where we used the macros before the compilation.

In the above code,

we define the macros

#define MINIMUM2(s1,s2) ((s1<s2?s1:s2))

and create the main function and declare the variable.

after that, print the message by using the instruction cout and store the value enter by the user into the variable by using the instruction cin.

then, we use the macros the process copy the information ((s1<s2?s1:s2))

and replace where we call macros in the code.

so, actually before compilation

 int min_Value = MINIMUM2(s1,s2);

the above statement becomes

 int min_Value = ((s1<s2?s1:s2));

the above is a ternary operator, if s1 < s2 gives true then s1 will be the output otherwise s2 will be output.

and finally, we display the output on the screen.

You might be interested in
Let PALINDROME_DFA= | M is a DFA, and for all s ∈ L(M), s is a palindrome}. Show that PALINDROME_DFA ∈ P by providing an algorit
denis-greek [22]

Answer:

Which sentence best matches the context of the word reticent as it is used in the following example?

We could talk about anything for hours. However, the moment I brought up dating, he was extremely reticent about his personal life.

Explanation:

Which sentence best matches the context of the word reticent as it is used in the following example?

We could talk about anything for hours. However, the moment I brought up dating, he was extremely reticent about his personal life.

8 0
3 years ago
What standards organization maintains the ethernet standard?.
Fofino [41]

Answer:

Ethernet standards are written and maintained by the IEEE, the Institute of Electrical and Electronic Engineers which has its corporate office in New York City and its operations center in Piscataway, New Jersey.

Explanation:

5 0
2 years ago
How do I fix this on my HiSense Roku tv this is on Xfinity Stream Beta the error number is -500
yawa3891 [41]

Answer:

it is something that you have to call your nearest xfinity store

i had the same problem but got it fixed

Explanation:

7 0
3 years ago
Read 2 more answers
The class ________ is the portion of a class that is visible to the application's programmer.
Lady_Fox [76]

The correct option to this question is class interface.

The class interface is the portion of a class that is visible to the application’s programmer. Class interfaces mean implementation of public methods of the class. These class interfaces of the class are easily visible to the application’s program either the one who is developing the application program or the one who is reading the application’s code.

Class interface can be seen by the other classes as its public face. Class interfaces separate the class’s implementation and its interaction with other classes. That way the implementation of the class can be modified easily without being known by other classes. Basically, the programmer who is developing the program, all the portions of the programm is visible to that programmer.

For example, the class is written below:

class class-name

{

private members;

public method()

{

//method defination

}

}

when the class object is created, the code of the object to the programmer is visible.

<u>While the other options are incorrect:</u>

  • Form: the form is used to collect information from the user. It can be build using front-end development tools
  • Design: Design is a term used in computer or software engineering to make something from scratch or beginning. It can be  methodologies, standards, or techniques etc.
  • Control: Control is the mechanism or a term used in software development to control the program or execution of the program.

You can learn more about class interface at

brainly.com/question/13089781

#SPJ4

The complete question is found while searching over internet:

"

<em>The class ________ is the portion of a class that is visible to the application's programmer.</em>

  • <em>Interface</em>
  • <em>Form</em>
  • <em>Design</em>
  • <em>Control </em>

"

7 0
2 years ago
Right now I have an i5 2400 and a PYN XLR8 gaming GTX 1650 Super, my CPU is too weak for 1080p gaming, what CPU should I get tha
Dmitry_Shevchenko [17]

Answer:

if its a number you need 5600GHz but im not to sure

Explanation:

8 0
3 years ago
Read 2 more answers
Other questions:
  • Instructions: Type the correct answer in the box. Spell the word correctly.
    5·2 answers
  • There are two types of short-term memory: one type is involved in the input and storage of new information, the other type of sh
    9·1 answer
  • What part of a check is the LEAST important?
    14·2 answers
  • What is the primary reason that organizations change their structure through downsizing, outsourcing, and offshoring as a means
    14·1 answer
  • Write a program that reads a target string from the keyboard and then another sentence string from the keyboard.
    10·1 answer
  • If you press the key corresponding to letter A on the keyboard, what process is carried out inside the CPU to display the letter
    10·1 answer
  • Write a shell script called SpellOutDate that prints the detail of the current date in separate lines. For example if the curren
    13·1 answer
  • I have a question on an IT crossword the question is as follows
    12·1 answer
  • Who is the intended audience of a pseudocode document?
    14·1 answer
  • How to transfer word 2019 from one computer to another
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!