Make Complicated Comparisons : Comparison Operators « Language Basics « Visual C++ .NET






Make Complicated Comparisons

 


#include "stdafx.h"
#using <mscorlib.dll>
using namespace System;
int main(void) {
    int value1 = 10;
    int value2 = 20;
    int value3 = 30;
    if (((value1 == 10) && (value2 == 20)) || (value3 == 25))
        Console::WriteLine ("This expression is true.");
    if ((value1 == 10) && ((value2 == 20)) || (value3 == 25))
        Console::WriteLine ("This expression is true.");
    return 0;
}

   
  








Related examples in the same category

1.Branch Based on a Comparison