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 statements is true of alert files?
ozzi

Answer:

They are only generated by Wireshark.

3 0
3 years ago
The fastest way to get help is to type a word or two in the search box.
Elanso [62]
The fastest way to get help is to type a word or two in the search box. TRUE.
5 0
3 years ago
Write a question that the database will understand. Which records do not contain "sold"?
astraxan [27]

Answer:

b

Explanation:

b

4 0
2 years ago
A(n) __________ can include a computer's full operating system, applications, and system settings, including security and config
babymother [125]

Solution:

It is done by Operating system.

An Operating system is system software that manages computer hardware and software resources and provides common services for computer programs.

Time-sharing operating systems schedule tasks for efficient use of the system and may also include accounting software for cost allocation of processor time, mass storage, printing, and other resources.

For hardware functions such as input and output and memory allocation, the operating system acts as an intermediary between programs and the computer hardware, although the application code is usually executed directly by the hardware and frequently makes system calls to an OS function or is interrupted by it. Operating systems are found on many devices that contain a computer – from cellular phones and video game consoles to web servers and supercomputers.


5 0
3 years ago
What is the primary purpose of the software package offered by hyper-v called guest integration services?
zysi [14]

Solution:

Guest integration services resolves compatibility issues of certain guest operating systems experiencing non-functioning features.

Data integration service is the employment of a group of services that comply with service-oriented architecture. Data integration service can perform in an N -> 0 latency time period. At the same time, it offers a powerful set of transformation processes for meeting an array of business imperatives. The advantages of employing data integration as an enterprise service include reduced time for marketing, a reduction in total cost of ownership (TCO), and a solution to the obsolete and expensive data-integration patterns presently available in corporate businesses.

This is the required answer.

6 0
3 years ago
Other questions:
  • What does cro stand for?
    7·2 answers
  • Write a for loop to print all elements in courseGrades, following each element with a space (including the last). Print forwards
    7·1 answer
  • Using an LCD projector to show an online video to a group of people is an example of:
    14·1 answer
  • Which resource helps a user access a cloud service?
    8·1 answer
  • (Statistics) Write a program that includes two functions named calcavg() and variance(). The calcavg() function should calculate
    10·1 answer
  • It is a blueprint of a project​
    9·2 answers
  • Which Backstage view feature helps you to specifically remove customized information from a document? Protect Document Feedback
    14·1 answer
  • The Binary Search algorithm works by testing a mid-point, then eliminating half of the list.
    8·1 answer
  • In a computer-controlled greenhouse, a temperature sensor and a window motor are connected to the computer.
    10·1 answer
  • processing C. have only one function, e.g. control traffic lights in a town, games machines 7 To create a formula, you first: A.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!