Advertisement
Guest User

C# - Relational Operators (C# Shell App Paste)

a guest
Apr 25th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.02 KB | None | 0 0
  1. //Disclaimer: The creator of 'C# Shell (C# Offline Compiler)' is in no way responsible for the code posted by any user.
  2. using System;
  3.  
  4. class Program
  5. {
  6.  
  7.    static void Main(string[] args)
  8.    {
  9.       int a = 21;
  10.       int b = 10;
  11.      
  12.       if (a == b) {
  13.          Console.WriteLine("Line 1 - a is equal to b");
  14.       } else {
  15.          Console.WriteLine("Line 1 - a is not equal to b");
  16.       }
  17.      
  18.       if (a < b) {
  19.          Console.WriteLine("Line 2 - a is less than b");
  20.       } else {
  21.          Console.WriteLine("Line 2 - a is not less than b");
  22.       }
  23.      
  24.       if (a > b) {
  25.          Console.WriteLine("Line 3 - a is greater than b");
  26.       } else {
  27.          Console.WriteLine("Line 3 - a is not greater than b");
  28.       }
  29.      
  30.       /* Lets change value of a and b */
  31.       a = 5;
  32.       b = 20;
  33.      
  34.       if (a <= b) {
  35.          Console.WriteLine("Line 4 - a is either less than or equal to  b");
  36.       }
  37.      
  38.       if (b >= a) {
  39.          Console.WriteLine("Line 5-b is either greater than or equal to b");
  40.       }
  41.    }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement