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
Bingel [31]
3 years ago
11

Give an example of an operationin a programming languagethat is implemented.

Computers and Technology
1 answer:
Shtirlitz [24]3 years ago
4 0

answer:  

(i) #include <iostream>  

using namespace std;  

int main() {  

int n1,n2,max;  

cin>>n1>>n2;  

if(n1>n2)//finding maximum between n1 and n2 in the program directly.  

max=n1;  

else  

max=n2;  

cout<<max;  

return 0;  

}  

(ii)  

#include <iostream>  

using namespace std;  

int maximum(int n1 ,int n2)  

{  

if(n1>n2)//finding maximum between n1 and n2 using function.  

return n1;  

else  

return n2;  

}  

int main() {  

int n1,n2,max;  

cin>>n1>>n2;  

max=maximum(n1,n2);  

cout<<max;  

return 0;  

}  

(iii)  

#include <iostream>  

using namespace std;  

inline int maximum(int n1 ,int n2)  

{  

return (n1>n2)? n1:n2;  

}  

int main() {  

int n1,n2,max;  

cin>>n1>>n2;  

max=maximum(n1,n2);//Finding maximum using inline function.  

cout<<max;  

return 0;  

}  

Output:-  

54 78  

78  

all three codes give the same output.  

Explanation:  

In part (i) I have done the operation in the main function directly.  

In part(ii) I have used function to calculate the maximum.  

In part(iii) I have used inline function to calculate maximum.  

You might be interested in
What is the best low end pc recording software​
julsineya [31]

Explanation:

democreator

D3DGear

nvidia shadow play etc

8 0
3 years ago
Read 2 more answers
If you need to multiply 50 and 8 and divide by 2, what would you type on the numerlc keypad?
nata0808 [166]

Answer:

50*8/2

The asterisk is the multiplication sign and the parenthesis is the division.

I've never used an apostrophe for a multiplication sign before, but I'm guessing multiplication is what it stands for.

Explanation:

4 0
3 years ago
9. Which of the following prefixes which relate to bytes are arranged from the smallest to the largest? a) mega, giga, tera, kil
dem82 [27]

Answer:

Explanation:

C

kilo = 1000

mega = 1,000,000

giga = 1 billion = 1 000 000 000

tera = 1 trillion = 1 000 000 000  000

6 0
3 years ago
How would a barcode reader be used in a healthcare industry?​
Leto [7]

Answer:

As you know the on going situation we are in, barcodes can be really useful for an example using them to check into a building that way when there is a infected person it is a really esay process to track down people that have been in that area.

5 0
3 years ago
Los organos de los sentidos perciben de la misma manera un estimulo?porque?
xeze [42]

Espero que te ayude!!!!

3 0
3 years ago
Other questions:
  • A website sells illegal and counterfeited materials. According to which law can the US Attorney General seek a court order to re
    5·2 answers
  • Lee finishes entering all the data. Next, he wants to format the header row so it is easier to read and stands out from the rest
    11·1 answer
  • Which of these shortcuts becomes available only when text is highlighted?
    10·1 answer
  • When using a file name you have to use only lower case letters<br>true or false
    11·1 answer
  • Which of the following best explains the different between Cut and Copy? a. When you copy text you are permanently deleting it,
    5·2 answers
  • In this program we are going to practice using the Math class by computing some important values on the unit circle. Using the a
    5·1 answer
  • How do open online courses help with independent learning
    6·2 answers
  • If we ignore the audio data in a video file, a video file is just a collection of many individual frames (i.e., images). What is
    6·1 answer
  • Can some one help me answer this question plz
    8·1 answer
  • Write a class named Employee that has private data members for an employee's name, ID_number, salary, and email_address. It shou
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!