if c#
int a = 5;
int b = 10;
if (b > a) //true
{
b = b - a;
}
if c#
int a = 5;
int b = 10;
if (b > a) //true
{
b = b - a;
}
c# if else
using System;
namespace DecisionMaking
{
class Program
{
static void Main(string[] args)
{
/* local variable definition */
int a = 100;
int b = 20
/* check the boolean condition */
if (a < b)
{
/* if condition is true then print the following */
Console.WriteLine("a is less than " + b);
}
else
{
/* if condition is false then print the following */
Console.WriteLine("a is not less than " + b);
}
Console.ReadLine();
}
}
}
=======OUTPUT========
output >> a is not less than 20
if c#
int time = 22;
if (time < 10)
{
Console.WriteLine("Good morning.");
}
else if (time < 20)
{
Console.WriteLine("Good day.");
}
else
{
Console.WriteLine("Good evening.");
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us