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
A ____ transmits all data received to all network devices connected to it, regardless of which device the data is being sent to.
Alecsey [184]

A Hub transmits all data received to all network devices connected to it, regardless of which device the data exists being sent to.

<h3>What is Hub?</h3>

A hub stands for the connection point in a computer device where data from numerous directions converge and are then sent out in many directions to respective devices. A hub may even act as a switch by preventing distinct data packets from proceeding to a destination. There exist three types of network hubs: passive, active, and intelligent.

A network hub exists as a node that broadcasts data to every computer or Ethernet-based device connected to it. A hub stands less sophisticated than a switch, the latter of which can isolate data transmissions to specific devices. Network hubs stand best suited for small, simple local area network (LAN) environments.

Hence,  A Hub transmits all data received to all network devices connected to it, regardless of which device the data exists being sent to.

To learn more about Hub refer to:

brainly.com/question/25804256

#SPJ4

7 0
2 years ago
Escribe todas las posibles combinaciones que pueden haber entre 4 bits.
Vedmedyk [2.9K]

Answer:

The answer is "\bold{2^n\ \  _{where} \ \ \ n \ is\ bit }"

Explanation:

The Combinations could be produced by using n-bits 2^n . It s enables you to generate the 4-bit numbers that are:

\to  2^4 = 16 combinations.

for the 4-bit, the combination of 2 = 16, which are its possible combination and for the   10 variations  appropriate 16 combinations are used,  As we know for 4 bit 16 Combinations can be generated which are from 0 to 15.

7 0
3 years ago
10. Calculate the checksum for blocks of data with the following byte sum. (a) 1220 (b) 950​
OLga [1]

Answer:kalo gk salah yang

a

Explanation:

5 0
3 years ago
Write. A program to fine the difference of two number 25 and 17 . Also displays the output
Anon25 [30]

Answer:

Answer = 25-17

print("25-17", Answer)

Explanation:

You put the sum into a variable which in this case would be Answer and then you can output it with the question.

6 0
3 years ago
Suppose you would like to urgently deliver 40 terabytes data from boston to los angeles. you have available a 100 mbps dedicated
kotykmax [81]
FedEx overnight. It would take about 35 days to transfer all 40 terabytes. It would only move 4.32 terabytes of data in 12 hours.
4 0
3 years ago
Other questions:
  • Which of the following enabled mass production in the 1920s? a.standardization of spare parts b.mass availability of electricity
    7·2 answers
  • The Distribute commands will evenly distribute the rows and columns within what? The width and height of the document. The width
    5·1 answer
  • How can this be achieved? Universal Containers stores invoices in SAP. Users want to view invoice data onthe related Account rec
    9·1 answer
  • To comply with ATC instructions for altitude changes of more than 1,000 feet, what rate of climb or descent should be used?
    5·1 answer
  • Can someone help me with my homework?
    7·1 answer
  • What is used to connect computers to the internet*Audio Ports
    15·2 answers
  • Which statement creates a StudentIDs object given the following code: public class StudentIDs&gt; { private TheType item1; priva
    15·1 answer
  • 1) Given what you have learned about computers and information technology thus
    6·1 answer
  • What is the 6 example of computer hardware and explain​
    6·1 answer
  • the actual use and implementation of computer started after third generation justify this statement in your own words.​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!