using System;
namespace Conditional_Statements
{
class Program
{
static void Main(string[] args)
{
int numbers;
Console.WriteLine("Wnter Your Percentage");
numbers=Convert.ToInt32(Console.ReadLine());
if (numbers < 40)
{
Console.WriteLine("You failed");
}
else if ((numbers >= 40) && (numbers < 50))
{
Console.WriteLine("You got E grade");
}
else if ((numbers >= 50) && (numbers < 60))
{
Console.WriteLine("You got D grade");
}
else if ((numbers >= 60) && (numbers < 70))
{
Console.WriteLine("You got C grade");
}
else if ((numbers >=70) && (numbers < 80))
{
Console.WriteLine("You got B grade");
}
else if ((numbers >= 80) && (numbers < 90))
{
Console.WriteLine("You got A grade");
}
else if ((numbers >=90) && (numbers <=100))
{
Console.WriteLine("You got A* grade");
}
else
{
Console.WriteLine("Invalid Percentage");
}
Console.ReadKey();
}
}
}
namespace Conditional_Statements
{
class Program
{
static void Main(string[] args)
{
int numbers;
Console.WriteLine("Wnter Your Percentage");
numbers=Convert.ToInt32(Console.ReadLine());
if (numbers < 40)
{
Console.WriteLine("You failed");
}
else if ((numbers >= 40) && (numbers < 50))
{
Console.WriteLine("You got E grade");
}
else if ((numbers >= 50) && (numbers < 60))
{
Console.WriteLine("You got D grade");
}
else if ((numbers >= 60) && (numbers < 70))
{
Console.WriteLine("You got C grade");
}
else if ((numbers >=70) && (numbers < 80))
{
Console.WriteLine("You got B grade");
}
else if ((numbers >= 80) && (numbers < 90))
{
Console.WriteLine("You got A grade");
}
else if ((numbers >=90) && (numbers <=100))
{
Console.WriteLine("You got A* grade");
}
else
{
Console.WriteLine("Invalid Percentage");
}
Console.ReadKey();
}
}
}
Comments
Post a Comment