0% found this document useful (0 votes)
10 views

Program: Using Using Using Using Using Namespace Class Static Void String Char Do

The document contains code for a C# program that takes in a student's name, subject, and marks. It uses a switch statement to output the grade based on the subject and marks, otherwise it outputs that they failed.

Uploaded by

Raees Khan
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Program: Using Using Using Using Using Namespace Class Static Void String Char Do

The document contains code for a C# program that takes in a student's name, subject, and marks. It uses a switch statement to output the grade based on the subject and marks, otherwise it outputs that they failed.

Uploaded by

Raees Khan
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

using System;

using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace program_4
{
class Program
{
static void Main(string[] args)
{
char isContinue = 'y';
do
{

Console.WriteLine("Enter your name");


string name = Console.ReadLine();
Console.WriteLine("Enter your subject name");
string subjectname = Console.ReadLine();
Console.WriteLine("Enter your marks ");

switch (subjectname)
{
case "islamiyat":
Console.WriteLine("your marks are 65/70, Congratulations your grade
is A+");
break;

case "mathematics":
Console.WriteLine("your marks are 60/70,Congratulations your grade is
A");
break;

case "pakstudies":
Console.WriteLine("your marks are 50/70,Congratulations your grade is
B");
break;

default:
Console.WriteLine("soory you are fail");
break;
}
Console.WriteLine("press y if you want to continue,else press any key to
exit");
isContinue=Console.ReadKey().KeyChar;
}while(isContinue=='y' || isContinue == 'Y');

}
}

You might also like