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
raketka [301]
3 years ago
13

Write c++ program to find maximum number for three variables using statement ?​

Computers and Technology
1 answer:
pantera1 [17]3 years ago
3 0

Answer:

#include<iostream>

using namespace std;

int main(){

int n1, n2, n3;

cout<<"Enter any three numbers: ";

cin>>n1>>n2>>n3;

if(n1>=n2 && n1>=n3){

cout<<n1<<" is the maximum";}

else if(n2>=n1 && n2>=n3){

cout<<n2<<" is the maximum";}

else{

cout<<n3<<" is the maximum";}

return 0;

}

Explanation:

The program is written in C++ and to write this program, I assumed the three variables are integers. You can change from integer to double or float, if you wish.

This line declares n1, n2 and n3 as integers

int n1, n2, n3;

This line prompts user for three numbers

cout<<"Enter any three numbers: ";

This line gets user input for the three numbers

cin>>n1>>n2>>n3;

This if condition checks if n1 is the maximum and prints n1 as the maximum, if true

<em>if(n1>=n2 && n1>=n3){</em>

<em>cout<<n1<<" is the maximum";}</em>

This else if condition checks if n2 is the maximum and prints n2 as the maximum, if true

<em>else if(n2>=n1 && n2>=n3){</em>

<em>cout<<n2<<" is the maximum";}</em>

If the above conditions are false, then n3 is the maximum and this condition prints n3 as the maximum

<em>else{</em>

<em>cout<<n3<<" is the maximum";}</em>

return 0;

You might be interested in
Program ___________________ are written explanations that are not part of the program logic but that serve as documentation for
Aleks04 [339]

Answer:

Program Comments

Explanation:

program comments are explanations. They are not executable code and the can actually appear anywhere in your code. Their main function is code documentation for the future. In Java programming language for example three types of comments is used. These are

// Single line comments  (This starts with two forward slashes

/* Multiple Line

comment

Style*/    

The third is the javadoc that gives a description of a function. I looks like the multiple line but is has two asterics

/** This is javadoc

comment

style*/

8 0
3 years ago
A _______ is a particular type of report that is made up of strategic objectives and metrics to help the organization reach its
Reika [66]

Answer:

A balanced score card is a particular type of report that is made up of strategic objectives and metrics to help the organization reach its target measures in line with strategic goals

Explanation:

A balanced scorecard is a framework for strategic planning and performance , which be presented in the form of a report.It clearly outlines organizational goals into measurable quantities such as time, quality of service or product, performance and cost. With a balanced scorecard, the organization can set a strategy and measure it and then effectively monitor and track the progress and results of the strategy.

5 0
4 years ago
Semiconductor memory is used mainly for primary storage even with its high cost. In another hand, the magnetic tape is the cheap
Charra [1.4K]
<span>Storage costs of magnetic tape are much lower than semiconductor storage (chip storage), but they take longer to access because they are not on-board the system and have to be added manually. Chip memory, on the other hand, can be used as primary storage for a system even with a higher cost because it's typically directly connected to the system board and is much more easily accessible by the system.</span>
8 0
3 years ago
What is one of the key components of a typical formula?
hoa [83]

A formula key components are:

  • Functions
  • References
  • Operators
  • Constants.

<h3>What is a formula?</h3>

This is known to be a kind of mathematical relationship or rule that is said to be expressed in form of symbols.

Therefore, A formula key components are:

  • Functions
  • References
  • Operators
  • Constants.

Learn more about formula from

brainly.com/question/2005046

#SPJ11

4 0
2 years ago
Flammable and combustible materials should be stored according to: A. Their color B. Their fire characteristics C. Their size
iris [78.8K]

B. their fire characteristics

this should be fairly obvious

6 0
3 years ago
Read 2 more answers
Other questions:
  • Calculate the total number of bits transferred if 200 pages of ASCII data are sent using asynchronous serial data transfer. Assu
    5·1 answer
  • Allison needs to graph the yearly average snowfall in Alaska. She should use a:
    13·2 answers
  • HTTP is made to facilitate which kind of communication?
    11·1 answer
  • You use a ____ following the closing brace of an array initialization list.
    12·2 answers
  • Which describes which CTSO each student should join?]
    7·1 answer
  • Create the Following Menu in a loop so the menu will continually show until the user chooses to exit.AddMultiplyExitAdd a value
    10·1 answer
  • Which of the following is a windows that allows you to temporarily store text
    15·1 answer
  • Why are your interactive ads so broken?
    15·1 answer
  • The five types of personal computers are: desktops, laptops, tablets, smartphones, and
    9·1 answer
  • Is it possible to code your own game and if so then where should I go to learn and how to publish it?
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!