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
what will happen to the contents of the destination ell if you copy the contents of the source cell into the destination cell
DochEvi [55]

Answer:

It's content will be replaced with a content from the source cell.

7 0
3 years ago
If you use a surrogate key, you must ensure that the candidate key of the entity in question performs properly through the use o
Colt1911 [192]
Hello  <span>Abigailguzman6347</span><span>


</span>Answer: If you use a surrogate key, you must ensure that the candidate key of the entity in question performs properly through the use of "unique index" and "not null" constraints.

Hope This Helps!
-Chris
6 0
3 years ago
A technician is training a new hire on sealing an RJ-45 connector to the end of an Ethernet cable. Which tool is the technician
Aleonysh [2.5K]

<em>The answer is Crimper. </em>

<em> </em>

<em>Crimper is a networking device that would allow RJ-45 pins to get attached to UTP(Unshielded Twister Pair), CATs (Category Ns) and STPs (Shielded Twisted Pair) Cables. These are common type of cables used in computer networking. A crimper looks like a pliers only it has narrow ends with a hole where you would put RJ-45 devices together with the cables. In order to make the cable hold on to the RJ-45, the two hands must be squeezed together with an exact force (not too much force). Once the crimper made a sound, that means, your RJ-45 is now locked with the cables inside.  </em>

<em> </em>

<em>You must be very careful when using this device. Sometimes crimpers has blades that could peel off cables or cut them for alignment and proper attachments. A pair of gloves and googles are also advisable to wear when you use this device for safety measures.</em>

8 0
3 years ago
Which one is not an operating system?1.mac 2.Microsoft office3.Iso.3.Android
quester [9]
It's either microsoft or office. Based on research I would say office.

I really hope this helps you! :-)
6 0
3 years ago
What sound customization option would you use in Scratch to simulate a sound happening in a large, empty room (like a theater)?
denis23 [38]
C. Echo ( I May Be Wrong )
8 0
2 years ago
Other questions:
  • Complete the paragraph to explain how Angelina can notify readers that her report is just a draft. Angelina has decided to add t
    12·2 answers
  • Peter has recently bought a media player and a digital camera. He wants to buy a memory card for these devices. Which memory dev
    12·2 answers
  • Which resource helps a user access a cloud service?
    8·1 answer
  • What is the output of the following function if the array nums contains the values 1 2 3 4 5 int backwards(int nums[]) { for (x
    15·1 answer
  • When a user inserts a PivotTable, where will it be inserted?
    15·1 answer
  • Create a list with 5 numbers and find the smallest and largest number in the list and also the sum and product of the numbers in
    9·1 answer
  • Give me 4 examples of things to consider as a sound designer?<br> HURYYYYY IM TIMED
    11·1 answer
  • 1. If we want define style for an unique element, then which css selector will
    14·1 answer
  • he attributes for an iframe are controlled by CSS. One of the iframe controls is "seamless." This means it _____. will blend the
    11·1 answer
  • What is software?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!