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
What happen if ignore the unsafe markings in hand tools in ict​
Snowcat [4.5K]

Answer:

Getting it right will not only protect employees and visitors from harm, it will also help to create a safe, productive workplace and mean that businesses can avoid any unnecessary financial loss.

4 0
3 years ago
Complex calculations show that if the universe is geometrically flat, we should observe the greatest temperature differences bet
Rufina [12.5K]

Answer:

Answer is 1 degree.

Explanation:

W MAP stands for Wilkinson Anisotropy Probe which was working from 2001 to 2010 .It usually measured the temperature differences.Big Bang was a partnership with NASA and Princeton University. So if universe is geometrically flat we should observed that temperate between patches are separated by 1 degree.Because Universe is oval shape and contain 360 angular shape but if it goes flat we can see the patches at very low distance that is 1 degree.

7 0
4 years ago
Which fingers do you use to type the following letters rtgvf
Allushta [10]
Middle,index,index,thumb,middle
3 0
3 years ago
Network firewall entry and exit points are called
LuckyWell [14K]
___the answer is ports
6 0
4 years ago
What is true about music from the Romantic period?
avanturin [10]
The answer to the given question above is the third option: <span>It was longer and less constrained than the music of the Classical period. The Romantic Period in music actually has more freedom in design and form. During this period, music were even more artistic and intellectual as well. Romantic Period occurred the late 18th century until early 19th century.</span>
8 0
3 years ago
Read 2 more answers
Other questions:
  • What systemctl command configures a unit to start the next time the computer boots?
    10·1 answer
  • The sequence of folders to a file or folder is called a(n) ________
    8·1 answer
  • It is safe to stand on the top step of a ladder provided it is braced property
    10·1 answer
  • Calculate the data rate capacity for a 2400 baud signal where there are M=8 levels per symbol. a. 2400 bps b. 4800 bps c. 7200 b
    12·1 answer
  • Piers wants to take a course on XML. He is a certified web designer, but he has not used XML before. How can he use XML to impro
    8·1 answer
  • Your _______ can help block inappropriate content online.<br> 1. web browser<br> 2. Password
    14·1 answer
  • Madeleine's Instructor praised her for capturing a nearly perfect image. It included dominance, harmony, and proportion among ot
    13·1 answer
  • Explain the different type of shift register counter ​
    14·1 answer
  • Make a program that receives several integers (the program ends when a negative number is entered) and shows how many times the
    14·1 answer
  • Write a pseudocode algorithm to ask the user to input the name of a student, the marks he/she received in a test and the worth o
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!