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
Which of the following would determine how many elements are in values?
DiKsa [7]
I guess depends on the language but for both java and C++ answer 3 is correct.
3 0
3 years ago
Match the IP Protections Patent, Copyright and Trademark into the following cases:
Vesna [10]

Answer:

A) copyright

B) copyright

C)Trade mark

D) copyright

E)Patent

Explanation:

Patent can be regarded as a form of intellectual property which helps the owner of an invention to others to sell or use the invention for some period of time. Example of this is a patent that protect microwave oven.

trademark is form of intellectual property, this could be inform of symbols, words that differentiate the product of a party from another. Example of this is a bite of apple that represents apple products.

Copyright can be regarded as a legal right given to those that owns a intellectual property which gives him/her right to copy and exclude others from reaping from where they did not sow. The owner get exclusive right to reproduce the copy.

Below is the match of the intellectual property with the examples.

a. books, poems<> Copyright

b. music, movies, paintings<> Copyright

c. company logo<> Trademark

d. software<>Copyright

e. combinations of materials to make drugs<> patent

8 0
3 years ago
20 points for ez question lol
slega [8]
I think it might be the third on not certain
5 0
3 years ago
Read 2 more answers
Default tab stops are set in word every _______ inch. a. ¾ b. ½ c. 1 d. ¼
Dennis_Churaev [7]
A) 3/4 inch Meow! XD
6 0
3 years ago
Deb needs to add borders on the cells and around the table she has inserted into her Word document.
slavikrds [6]

Answer:

Design tab

Explanation:

  1. Select the call or table that you will like to use
  2. Then select the <em>design tab</em>
  3. In the group <em>page background</em> select <em>Page Borders</em>
  4. There you will have multiple choses for where you want your border
  5. You can even customize your border by pressing <em>Custom Border </em>at the bottom of the list for <em>Page Borders</em>
4 0
3 years ago
Read 2 more answers
Other questions:
  • Software designed specifically for managing real estate is an example of ________ software. Select one: A. e-commerce B. vertica
    7·1 answer
  • Will a pair of bar magnet ,with keepers on the two ends, act as a magnet
    13·1 answer
  • What is a digital certificate? Select one: a. It is a means of establishing the validity of an offer from a person, entity, web
    7·1 answer
  • What is the outside of an iPhone called?
    9·2 answers
  • Provide the definition for each of the following structures and unions:
    8·1 answer
  • How do u answer questions on brainly if ur on the app and on a phone. For me there is no answer button :(
    8·1 answer
  • What should you consider when developing your website content?​
    6·2 answers
  • Identify the selector in the following CSS code:
    10·1 answer
  • How can blockchain be used to support sustainable business practices?
    8·1 answer
  • A(n) ________ is a wonder of miniaturization combining a CPU, GPU, and sundry other support logic onto a single silicon die, sav
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!