publicvoidMain()
{
int s1 = 0;
int s2 = 0;
int s3 = 0;
int tot = 0;
double per = 0;
Console.WriteLine("Enter the mark of First Subject out of 100");
s1 = Console.ReadLine();
Console.WriteLine("Enter the mark of Second Subject out of 100");
s2 = Console.ReadLine();
Console.WriteLine("Enter the mark of Third Subject out of 100");
s3 = Console.ReadLine();
tot = s1 + s2 + s3;
per = (tot / 300) * 100;
Console.WriteLine("Your Total is:=>" + tot);
Console.WriteLine("your Percentage is:=>" + per);
switch ((per)) {
case// ERROR: Case labels with binary operators are unsupported : LessThan40:
Console.WriteLine("Grade:=>Fail");
Console.ReadLine();
break;
case40:
case41:
case42:
case43:
case44:
case45:
case46:
case47:
case48:
case49:
case50:
Console.WriteLine("Grade:=>Second Class");
Console.ReadLine();
break;
case50:
case51:
case52:
case53:
case54:
case55:
case56:
case57:
case58:
case59:
case60:
Console.WriteLine("Grade:=>First Class");
Console.ReadLine();
break;
case// ERROR: Case labels with binary operators are unsupported : GreaterThan70:
Console.WriteLine("Grade:=>Distionction");
Console.ReadLine();
break;
}
}
0 comments
Comments
Join the conversation! Your thoughts help the community grow.
Join to leave a comment
Members earn 10 SHARP for a comment, 10 SHARP for a reaction, and 250 SHARP for every blog they publish.
Join the conversation! Your thoughts help the community grow.