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 technology allows you to hide the private IP address of a system from the Internet?a. SSLb. RADIUSc. PPTPd. NAT
Greeley [361]

Answer:

The answer is "Option d".

Explanation:

In networking, NAT refers to the Network Address Translation. This process is used to translate computer IP addresses into a single IP address in your local network. It allows private IP networks to connect to the Internet using unregistered IP addresses. and other options are incorrect that can be described as follows:

  • In option a, SSL stands for Secure Sockets Layer. It is used in transmission of documents or data over a network that's why it is not correct.
  • In option b, RADIUS stands for Remote Authentication Dial-In User Service. It is used to manage the data on a network.
  • In option c, PPTP stands for Point-to-Point Tunneling Protocol. It is used to provide a set of rules for communicating through a network that's why it is not correct.

6 0
3 years ago
15. How many PC’s can be connected to a UPS?
Alex_Xolod [135]

Answer: Depends on the power of the computer /computers and the UPS

Explanation: For someone who had a big connected network of computers and printers we would plug the computer or server into the UPS as well as the monitor and sometimes a printer sometimes the monitor was plugged into the wall

When you get a UPS you must plug it in for a certain time could be hours or even a day.  A USP has a big battery in it and you must charge it (sometimes it comes semi-charged but you must plug it in to strengthen it. )

there are two connector wires that you affix to the battery and you must put a lot of strength into it to make it secure.

So in closing, you can get away with two like a desktop and a laptop.

Read your documentation that comes with the UPS

6 0
1 year ago
When connecting a trunk link between two switches, it is important to configure the allowed VLANs correctly on either end. If th
Len [333]

Answer: A VLAN mismatch

Explanation:

 The VLAN mismatch is the process when the both ends of the truck line are not connected correctly and properly between the two switches.

  • The configuration of the VLAN is done correctly as it is important to connecting the VLAN on either of the ends for avoiding the VLAN mismatch occurrence.
  • By default the truck allow the VLAN 2094 for traversing the trunk by using the native VLAN in the form of VLAN 1.

Therefore, VLAN mismatch is the correct answer.

4 0
3 years ago
Why is it important to use fillings,coating/icing,glazes or decorations for pastry products​
Marizza181 [45]

Answer:

Frosting improves the cake's appearance.

Explanation:

Special occasion cakes become more festive with frosting and decorations; and, Frosting improves the keeping the qualities of the cake by forming a protective coating around it, sealing in moisture and flavor and allowing it to be eaten over a couple of days.

7 0
2 years ago
Modify the guessing-game program so that the user thinks of a number that the computer must guess.
olga_2 [115]

Answer:

import random

import math

smaller = int(input("Enter the smaller number: "))

larger = int(input("Enter the larger number: "))

count = 0

print()

while True:

   count += 1

   myNumber = (smaller + larger)

   print('%d %d' % (smaller, larger))

   print('Your number is %d' % myNumber)

   choice = input('Enter =, <, or >: ')

   if choice == '=':

       print("Hooray, I've got it in %d tries" % count)

       break

   elif smaller == larger:

       print("I'm out of guesses, and you cheated")

       break

   elif choice == '<':

       larger = myNumber - 1

   else:

       smaller = myNumber + 1

Explanation:

  • Inside an infinite while loop, add the smaller and larger number and assign that value to myNumber variable.
  • Check the choice and then print the relevant display message.
5 0
3 years ago
Other questions:
  • Many web browsers, including internet explorer, edge, chrome, and safari, have a(n) ____ option to browse the web without leavin
    12·2 answers
  • The ____ refers to a world where everyday physical objects are connected to, and uniquely identifiable on, the Internet so they
    6·1 answer
  • The name of a Variable effects its value<br><br> True<br><br> False
    7·1 answer
  • Which of the following statements is correct?
    14·1 answer
  • To change lowercase letters to uppercase letters in a smaller font size, which of the following should be done?
    10·1 answer
  • Use python
    9·1 answer
  • Discuss how the use of digital formats for audio-visual recording and editing has
    8·1 answer
  • What can be done to solve unemployment problem?​
    11·1 answer
  • Select the correct answer..
    6·1 answer
  • ACTIVITY NO. 5 (DAY 5) FACT OR BLUFF. Write Fact if the statement is correct and write Bluff if it is incorrect.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!