Q:

write c# program to read student mark between 0 to 10, then prints the result, either pass, or fail

0

write c# program to read student mark between 0 to 10, then prints the result, either pass, or fail

All Answers

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

internal class Program
{
    private static void Main(string[] args)
    {
        int mark;
        Console.Write("enter your mark: ");
        mark = Convert.ToInt32(Console.ReadLine());
        if (mark >= 6 && mark <= 10)
            Console.WriteLine("pass");
        else if (mark >= 0 && mark < 6)
            Console.WriteLine("fail");
        else Console.WriteLine("invalid input");
    }
}

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