If Statement or if else statement
If statement is a programming conditional statement that executes a code if a specified condition is true. If the condition is false, that code will be skipped.
If else statement is same as that of if statement where we can write n number of else if conditions. if the previous condition is false system will execute else if condition. if the previous condition is true else if conditions will be skipped.
Before entering coding part of if statement, we need to study 2nd type of operator called Relational Operator.
CODE
EG 1 . Get number from user, find Whether it is even number
static void Main(string[] args) {
    //If you use Console.Write(), the cursor in console will stay in same line
    Console.Write("Enter Number : ");
    int num = Convert.ToInt32(Console.ReadLine());
    //Checking the condition
    if (num%2 == 0) {
    Console.WriteLine("It is a even Number");
    }
}
EG 2 . Get number from user, find Whether it is even number or odd number
static void Main(string[] args) {
    //If you use Console.Write(), the cursor in console will stay in same line
    Console.Write("Enter Number : ");
    int num = Convert.ToInt32(Console.ReadLine());
    //Checking the condition for even number
    if (num%2 == 0) {
    Console.WriteLine("It is a even Number");
    }
    //Checking the condition for odd number
    if (num%2 != 0) {
    Console.WriteLine("It is a odd Number");
    }
}
EG 3 . Get number from user, find Whether it is even number, odd number or Whole number
static void Main(string[] args) {
    //Getting input from user
    Console.Write("Enter Number : ");
    int num = Convert.ToInt32(Console.ReadLine());
    //Checking the condition for Whole number
    if (num == 0) {
    Console.WriteLine("It is a whole Number");
    }
    //Checking the condition for Even number
    else if (num%2 == 0) {
    Console.WriteLine("It is a even Number");
    }
    /*if user entering interger number there could be 3 possible scenarios(even,odd or whole number). Already we written condition for Whole number and even number. if both condition is false the only possible scenario is going to be Odd number. so we used else. if all the above condition is false system will directly go inside else and that code will be executed.*/
    else {
    Console.WriteLine("It is a odd Number");
    }
}
(Click Here, For more exercises)