Q:

using method, read c# program asks student to enter his mark out of 10 , then prints the result, either pass or fail

0

using method, read c# program asks student to enter his mark out of 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
{
    public static bool pass(int mark)
    { 
        if(mark>=6)
            return true;
        else return false;
    }
    public static void Main()
    {
        Console.WriteLine("enter your mark, out of 10: ");
        int mark = Convert.ToInt32(Console.ReadLine());
        if (mark >= 0 && mark <= 10)
            pass(mark);
        else Console.WriteLine("invalid entry");
    }
}

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