Q:

write c# program to read student mark between 0 to 100, then prints the equal grade

0

write c# program to read student mark between 0 to 100, then prints the equal grade

if mark between 90 to 100 then grade is A,

if mark between 80 to 89 then grade is B,

if mark between 70 to 79 then grade is C,

if mark between 60 to 69 then grade is D,

if mark lower than 60 then grade is F

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

using System.Runtime.Intrinsics.X86;

internal class Program
{
    private static void Main(string[] args)
    {
        int mark;
        Console.Write("enter your mark: ");
        mark = Convert.ToInt32(Console.ReadLine());
        if (mark >= 90 && mark <= 100)
            Console.WriteLine("A");
        else if (mark >= 80 && mark < 89)
            Console.WriteLine("B");
        else if (mark >= 70 && mark < 79)
            Console.WriteLine("C");
        else if (mark >= 60 && mark < 69)
            Console.WriteLine("D");
        else if (mark >= 0 && mark < 60)
            Console.WriteLine("Fail");
    }
}

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now