1c. Create an application that receives the (Student Id, Student Name, Course Name, Date of Birth) information from a set of students. The application should also display the information of all the students once the data entered.

Program:



using System;

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

namespace Prac1_c
{
struct student

{
public int s_id;
public String s_name, c_name, dob;

}
class Program
{

static void Main(string[] args)
{

student[] arr = new student[4];

for (int i = 0; i < 2; i++)
{

Console.WriteLine("Please enter StudentId, StudentName, CourseName, Date-Of-Birth");

arr[i].s_id = Int32.Parse(Console.ReadLine());

3

arr[i].s_name = Console.ReadLine();
arr[i].c_name = Console.ReadLine();
arr[i].dob = Console.ReadLine();
}

for (int i = 0; i < 2; i++)
{

Console.WriteLine("Students Details:");
Console.WriteLine("Student ID:{0} ", arr[i].s_id);
Console.WriteLine("Student Name:{0} ", arr[i].s_name);

Console.WriteLine("Course name:{0} ", arr[i].c_name);
Console.WriteLine("DOB:{0} ", arr[i].dob);

}

Console.ReadKey();
}
}
}

Comments