C++ - less than: <

less than operator is a logical operator that is used to compare two numbers.

<

Description

par1 < par2
Used keywords: <

Input


Output

  • Result - logical value returns a true, if the first number is less than the second, otherwise false.
Note: it works over all types of numbers.
compatible programing languages:
Visual C++ .NET

Examples

C++

less than the possible of use:
a = 5 < 10;       // a = true 
b = 8 < x; 
if (y < 100)  
  x++; 

C++

even one example in what situations we can use the operation less than:
x < y
10 < f(5)
(i & j) < 128

C++

Other pieces of example codes:
do {
  i++;
  if (i==5)
    break;
} while ( i <10);
if (y<5)
   y = y/ 3.14;    // y = 1.234
a>1 || a<100
a = 5 < 10
ret = j<i
10 >a || a<5

you can find it in the following collections: relational operators
Languages: en hu cz sk