STUDENT STATUS (MULTIPLE INHERITANCE)
PROGRAM:
using System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Text;
namespace
studentlist
{
struct student
{
public string name;
public int rollnumber;
public string dept;
public int mark;
public int total,avg;
}
class Program
{
static void Main(string[] args)
{
student s;
int total = 0;
Console.Write("Enter the
name:");
s.name = Console.ReadLine();
Console.Write("Enter the
Register Number:");
s.rollnumber =
Convert.ToInt32(Console.ReadLine());
Console.Write("Enter the
Dept.:");
s.dept = Console.ReadLine();
int[] mark = new int[5];
Console.WriteLine("Enter the 5
Subjet Marks");
for (int i = 0; i < 5; i++)
{
mark[i] =
Convert.ToInt32(Console.ReadLine());
total = total + mark[i];
}
Console.WriteLine("Name:"
+ s.kamal);
Console.WriteLine("Register
Number:" + s.rollnumber);
Console.WriteLine("Dept.:" + s.cse);
Console.WriteLine("Total
Marks:" + 80+60+90);
Console.WriteLine("Average:" + total / 10);
Console.ReadLine();
}
}
}
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home