Write a C++ program that prompts the user to input three integer values and find the greatest value of the three values.
Example:
Enter 3 integer vales separated by space: 10 15 20
The greatest value is: 20
Code for coying
#include <iostream>
using namespace std;
int main()
{
int a,b,c;
cout << "Enter 3 integer vales separated by space: ";
cin >>a >>b >>c;
if ((a>=b) && (a>=c))
cout<<"The greatest value is:"<<a;
else if ((b>=a) && (b>=c))
cout<<"The greatest value is:"<<b;
else
cout<<"The greatest value is:"<<c;
return 0;
}
You might also like to view...
If a whine is from a CD or DVD drive, it will stop when the drive is not in use
Indicate whether the statement is true or false
With Excel in Edit mode, you can edit cell contents directly in the cell.
Answer the following statement true (T) or false (F)
Crandall's Creamery accumulates all business transactions throughout the day. At midnight, all transactions are processed. This is an example of ____.
a. OLTP b. batch processing c. real-time processing d. occurrence processing
The ____ band is intended for devices that provide short-range, high-speed wireless digital communications.
A. CDMA B. ISM C. UNII D. GSM