Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
606 B
2
Indexable
Never
using System;

class Program
{
    static void Main()
    {
        Console.Write("Enter student name: ");
        string name = Console.ReadLine();

        int total = 0;
        for (int i = 1; i <= 3; i++)
        {
            Console.Write($"Enter marks for Subject {i}: ");
            total += Convert.ToInt32(Console.ReadLine());
        }

        double average = total / 3.0;
        string grade = average >= 90 ? "Excellent" : average >= 75 ? "Good" : "Average";

        Console.WriteLine($"Student Name: {name}\nTotal Marks: {total}\nGrade Awarded: {grade}");
    }
}
Leave a Comment