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
Which of the following examines the organizational resource of information and regulates its definitions, uses, value, and distr
hichkok12 [17]

Answer:C)Information management

Explanation: Information management is the technique through which the organization and handling of the the data/ information takes place.This technique is made for helping the organization and their business for the supporting the function and processes.

The facilities provided by the information management system is  development, management, designing, innovation etc.

Other options are incorrect because they are used for the coding process,technology and governing of the data, hence no management activity is done by them.Thus, the correct option is option(C).

4 0
3 years ago
People are starting to type in whole questions rather than specific words, which leads credence to having _____ that have this a
SpyIntel [72]

Answer:

a. corporate blogs

Explanation:

corporate blog is the practice of creating content that addresses various topics which includes (updates, expert tips or best practices and company news) from the perspective of a brand. Also, blogs make posts and comments easy to reach and follow.

4 0
3 years ago
The windows troubleshooting utility that identifies and eliminates nonessential files is called _____.
Virty [35]
I think it is Defragment
8 0
3 years ago
Read 2 more answers
You must lower your high beams when within how many feet of an approaching vehicle?
drek231 [11]

2000 feet of any vehicle

7 0
3 years ago
Java what are synchronized functions.
adelina 88 [10]

<h2>answer:</h2>

Synchronized method is used to lock an object for any shared resource. When a thread invokes a synchronized method, it automatically acquires the lock for that object and releases it when the thread completes its task.','.

4 0
2 years ago
Other questions:
  • Generally speaking, mobile sites are good for acquiring new customers and inspiring new relationships while mobile apps are good
    6·1 answer
  • Robert needs to apply formatting from one set of text to multiple other sets of text throughout the document. Which option shoul
    7·1 answer
  • Which security control is most helpful in protecting against eavesdropping on wireless LAN (WLAN) data transmissions that would
    6·1 answer
  • Assume that the array arr has been defined and initialized with the values {4, 2, 5, 3, 1}. What are the values in the array arr
    15·1 answer
  • A runtime error is usually the result of:
    9·1 answer
  • Hi, please help me complete my Database Development 2 hw by completing what should been done from the document and show the code
    11·1 answer
  • Point out the wrong statement:
    7·1 answer
  • Mario kart is mercedes lol
    13·2 answers
  • Presentations must have what to be efffective
    8·1 answer
  • a value-returning method must specify as its return type in the method header. question 18 options: a) an int b) a double c) a b
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!