60 745
Assignments Done
97,8%
Successfully Done
In April 2018

Answer to Question #19348 in C++ for alaa

Question #19348
Write a C++ program that prompts the user to enter three integers. The program should out put the largest one
Expert's answer
#include<iostream>
using namespace std;
int main ()
{
int num1, num2, num3;
cout << "Enter 1 number: " << endl;
cin >> num1;
cout << "Enter 2 number: " << endl;
cin >> num2;
cout << "Enter 3 number: " << endl;
cin >> num3;

int largest = num1;
if (num2 > largest) {
& largest = num2;
}
if& (num3 > largest) {
& largest = num3;
}

cout << "Largest number: " << largest << endl;
system ("pause");
return 0;

}


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions