C++ program to find greatest number between three numbers

Levels of difficulty: / perform operation:

This program shows the greatest number between three numbers using if-else-if statement. It takes three numbers as input from user and output the greatest number.

C++ Program

using namespace std;
int main() {
	int num1,num2,num3;
	cout<<" Enter value for first number";
	cout<<" Enter value for second number";
	cout<<" Enter value for third number";
	if(num1>num2&&num1>num3) {
		cout<<" First number is greatest:"<<endl<<"whick is= "<<num1;
	} else if(num2>num1&&num2>num3) {
		cout<<" Second number is greatest"<<endl<<"whick is= "<<num2;
	} else {
		cout<<" Third number is greatest"<<endl<<"whick is= "<<num3;
	return 0;