# C# Program to Generate the Marksheet of the Student

This is a C# Program to generate the marksheet of the student.

Problem Description

This C# Program Generates the Marksheet of the Student.

Problem Solution

Here the student details are obtained from the user and the marksheet is generated based on the details.

Program/Source Code

Here is source code of the C# Program to Generate the Marksheet of the Student. The C# program is successfully compiled and executed with Microsoft Visual Studio. The program output is also shown below.

```/*
* C# Program to Generate the Marksheet of the Student
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Marksheet1
{
class Program
{
static void Main(string[] args)
{
int r, m1, m2, m3, t;
float p;
string n;
Console.WriteLine("Enter Roll Number :");
Console.WriteLine("Enter Student Name :");
Console.WriteLine("Mark of Subject1 : ");
Console.WriteLine("Mark of Subject2 : ");
Console.WriteLine("Mark of Subject3 : ");
t = m1 + m2 + m3;
p = t / 3.0f;
Console.WriteLine("Total : " + t);
Console.WriteLine("Percentage : " + p);
if (p >= 35 && p < 50)
{
}
if (p >= 50 && p <= 60)
{
}
if (p > 60 && p <= 80)
{
}
if (p > 80 && p <= 100)
{
}
}
}
}```
Program Explanation

In this C# program, we are reading the Roll Number, Student Name, Mark of Subject1, Mark of Subject2, and Mark of Subject3 using ‘r’, ‘n’, ‘m1’, ‘m2’ and ‘m3’ variables respectively.

Compute the summation of total marks obtained by the user in three subjects. Divide the total marks in all the subjects by total number of subjects to compute the average. Print the student details obtained from the user and generate the marksheet based on the details.

Runtime Test Cases
```
Enter RollNumber :
48
Enter Student Name :
sri
Mark of Subject1 :
90
Mark of Subject2 :
80
Mark of Subject3 :
70
Total : 240
Percentage : 80

Sanfoundry Global Education & Learning Series – 1000 C# Programs.

Note: Join free Sanfoundry classes at Telegram or Youtube
If you wish to look at all C# Programming examples, go to 1000 C# Programs.

If you find any mistake above, kindly email to [email protected]