Untitled
unknown
plain_text
a year ago
606 B
5
Indexable
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}"); } }
Editor is loading...
Leave a Comment