Question No # 1
CODE
static void Main(string[] args)
{
Console.WriteLine("Enter Year:-");
int year = Convert.ToInt32(Console.ReadLine());
if ((year % 4 == 0) && (year % 100 != 0 || (year % 400 == 0)))
{
Console.WriteLine(year + "is a leep year");
}
else
{
Console.WriteLine(year + " is not a leep year ");
}
Console.ReadLine();
}
}
}
Question No # 2
CODE
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Enter value Of 1st Angle ");
float a = Convert.ToSingle(Console.ReadLine());
Console.WriteLine("Enter value Of 2nd Angle");
float b = Convert.ToSingle(Console.ReadLine());
Console.WriteLine("Enter value Of 3rd Angle");
float c = Convert.ToSingle(Console.ReadLine());
if (a + b + c == 180)
{
Console.WriteLine("Triangle Is Valid");
}
else
{
Console.WriteLine("Traingle Is Not Valid ");
}
Console.ReadLine();
}
Question No # 3
CODE
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Enter Number");
int a = Convert.ToInt32(Console.ReadLine());
if (a % 2 == 0)
{
Console.WriteLine(" You Entered Even Number");
}
else
{
Console.WriteLine("You Entered An Old Number");
}
Console.ReadLine();
}
}
}
link
https://drive.google.com/file/d/1DqbD2XhJdUoyYhBGXpkg5FpiyRQBMwyP/view?usp=sharing
0 Comments