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
Which one of these tasks is part of the pre-production phase of game development?
Alexxx [7]
[B], developing the art style guide and production plan.

It wouldn't be [A], because patches are released to consumers of the game, to fix bugs and add new content, which won't be done until post-production.

It wouldn't be [C] either, as it is also post-production, because you are sending the game to produced, packaged and shipped, meaning the game has already been pretty much fully developed.
3 0
3 years ago
Read 2 more answers
Which branch of science helps avoid or minimize stress related injuries at workplace? _____ is a branch of science that aims to
QveST [7]

Answer:

Ergonomics

Explanation:

We can get stress injuries in the workplace, and the study of the stress injuries at workplaces is a very important branch of scientific study currently, and all companies from all the fields are working on it, and so are the academic and research institutions. And this branch has gained heights in the past 10 years as companies want to increase worker productivity as well as bring down the downtime as well as various injury claims related to the job. And we know this branch as "ergonomics".

5 0
3 years ago
In order for the image tag in an HTML file to function properly, the file named square.png must be located where?
andrey2020 [161]
A is wrong because a folder can have any name.
B is wrong because not all folders of a web server are exposed to the outside, only all folders below the document root.
C sounds good
D is wrong because an image can reside somewhere else as long as you specify the absolute or relative path to it
7 0
4 years ago
Read 2 more answers
#A year is considered a leap year if it abides by the #following rules: # # - Every 4th year IS a leap year, EXCEPT... # - Every
lara [203]

Answer:

To check if the year comes under each 100th year, lets check if the remainder when dividing with 100 is 0 or not.

Similarly check for 400th year and multiple 0f 4. The following C program describes the function.

#include<stdio.h>

#include<stdbool.h>

bool is_leap_year(int year);

void main()

{

int y;

bool b;

 

printf("Enter the year in yyyy format: e.g. 1999 \n");

scanf("%d", &y);     // taking the input year in yyyy format.

 

b= is_leap_year(y);  //calling the function and returning the output to b

if(b==true)

{

 printf("Thae given year is a leap year \n");

}

else

{

 printf("The given year is not a leap year \n");

}

}

bool is_leap_year(int year)

{

if(year%100==0)   //every 100th year

{

 if(year%400==0)   //every 400th year

 {

  return true;

 }

 else

 {

  return false;

 }

}

if(year%4==0)  //is a multiple of 4

{

 return true;

}

else

{

 return false;

}

}

Explanation:

Output is given as image

5 0
3 years ago
Please help me with opinions, ideas, any websites that would help, or chart, article, video, or podcast to help support your pos
valina [46]

Answer:

Check explanation.

Explanation:

So, i will be going supporting positive effect of how the reshaping of of the media has affected the film industry. Since brainly do not support me to include links to websites and videos I will only be sharing my opinions on the subject.

One of the ways the media is been reshaped is through the platform known as the Social Networking Sites. This platform has helped people to create an account with them, create content on their sites and share this content. With the development of this platform the film industry can put their content on this platform and show it to the world. On platforms like this, the films can be viewed and shared to many individuals.

These Platforms are been employed by film makers/industry to disseminate their content and also for the generation of revenue.

7 0
4 years ago
Other questions:
  • 11.
    11·1 answer
  • What is an effective way to display calculations in a Word document
    7·2 answers
  • With arbitrary code execution, the ________________ launches ("spawns") a command shell from which instructions can then be issu
    11·1 answer
  • Is anyone really good at immerse 2 learn??
    9·1 answer
  • Rewrite each condition below in valid Java syntax (give a boolean expression): a. x &gt; y &gt; z b. x and y are both less than
    7·1 answer
  • What is Java Script?
    13·1 answer
  • What is 5 times 5 times 16 times 11 2345
    6·2 answers
  • What is computer topology​
    5·2 answers
  • Which of the following uses the proper syntax for creating an HTML comment?
    8·1 answer
  • The residual volume can be measured directly with: Select an answer and submit. For keyboard navigation, use the up/down arrow k
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!