0% found this document useful (0 votes)
10 views1 page

P5

Uploaded by

tushar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views1 page

P5

Uploaded by

tushar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

using System;

namespace ConsoleApp5
{
class Program
{
static void Main(string[] args)
{
int totMarks;
Console.WriteLine("Enter the total amount of marks you got");
totMarks = int.Parse(Console.ReadLine());
if (totMarks >= 0 && totMarks <= 100)
{

if (totMarks >= 80)


{
Console.WriteLine("Grade A");
}

else if (totMarks >= 65 && totMarks <= 79)


{
Console.WriteLine("Grade B");
}
else if (totMarks >= 50 && totMarks <= 64)
{
Console.WriteLine("Grade C");
}
else if (totMarks >= 40 && totMarks <= 49)
{
Console.WriteLine("Grade D");
}
else
{
Console.WriteLine("Grade F");
}
}
else
{

while (totMarks >= 100)


{
Console.WriteLine("Please enter a no. between 0 to 100");
totMarks = int.Parse(Console.ReadLine());
}
}
Console.ReadLine();
}

You might also like