MY COMMAND(WHERE THE FIRST VALUE IS 25,25,12):
#include "stdafx.h"
#include<iostream>
using namespace std;
void main()
{int Data_1,Data_2,Data_3;
cout<<"key in first number:";
cin>>Data_1;
cout<<"key in second number:";
cin>>Data_2;
cout<<"key in third number:";
cin>>Data_3;
if((Data_1>Data_2)&&(Data_1>Data_3))
{
cout<<Data_1<<": is the biggest\n";
}
else if((Data_2>Data_1)&&(Data_2>Data_3))
{
cout<<Data_2<<": is the biggest\n";
}
else
{
cout<<Data_3<<": is the biggest\n";
}
}
MY OUTPUT:
key in first number:25
key in second number:25
key in third number:12
12: is the biggest
Press any key to continue . . .
Let's consider what that looks like when the variables have the values you entered:
if ((25 > 25) && (25 > 12))
25 > 25 is false, so the if statement evaluates to false. Therefore, the statement governed by the first if statement will not execute. Data_1 is not the biggest.