Comparing data values : Variables « Language Basics « C++ Tutorial






#include <iostream>
using std::cin;
using std::cout;
using std::endl;

int main() {
  char first = 10;
  char second = 20;

  cout << "The value of the expression first < second is: "
       << (first < second)
       << endl
       << "The value of the expression first == second is: "
       << (first == second)
       << endl;

  return 0;
}
The value of the expression first < second is: 1
The value of the expression first == second is: 0








1.3.Variables
1.3.1.Assign value to a variable
1.3.2.Dynamic initialization.
1.3.3.A scoping example
1.3.4.Using the unary scope resolution operator
1.3.5.Finding maximum and minimum values for data types
1.3.6.Comparing data values