Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / C#

<: practical reference

<: practical reference: < tests whether the left operand strictly precedes the right operand.

Version: C# operator reference; verified against C# 14

Syntax

left < right

< tests whether the left operand strictly precedes the right operand.

Use it for an exclusive bound and conventional indexed-loop conditions.

The comparison does not protect against earlier overflow and depends on operand types.

NaN produces false, while a lifted nullable comparison with null can also produce false.

The complete program actually uses <; its exact expected stdout is True.

Examples

using System;
using System.Linq;
using System.Threading.Tasks;

Console.WriteLine(3 < 4);

Result

True

The complete program actually uses `<`; its exact expected stdout is `True`.

Sources