12. if else in c#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ifelseexample
{
class Program
{
static void Main(string[] args)
{
int a, b;
Console.Write("Enter Value of A:");
a = Convert.ToInt16(Console.ReadLine());
Console.Write("Enter Value of B:");
b = Convert.ToInt16(Console.ReadLine());
if (a > b)
{
Console.WriteLine("A is Greater");
}
else
{
Console.WriteLine("B is Greater");
}
Console.Read();
}
}
Comments
Post a Comment