C#

structure Program using C# Language

structure Program using C# Language
using System;

struct Books

{

private string title;

private string author;

private string subject;

private int book_id;

public void getValues(string t,string a,string s,int id)

{

      title = t;

      author = a;

      subject = s;

      book_id = id;

}

public void display()

{

Console.WriteLine("\n");

Console.WriteLine("\nTitle      : {0}", title);

Console.WriteLine("\nAuthor     : {0}", author);

Console.WriteLine("\nSubject    : {0}", subject);

Console.WriteLine("\nBook_id    : {0}",book_id);

}

};

public class testStructure

{

public static void Main()

{

Books Book1=new Books();

Books Book2=new Books();

Book1.getValues("C# and .NET Framework","J.Liberty","Programming in C#",6221407);

Book2.getValues("C# and .NET Framework","Herbert Schildt","The Complete Reference",6221410);

Book1.display();    Book2.display();

} 

}
Senthilvelan Sambamoorthy

Senthilvelan Sambamoorthy is working as a Professor in Department of Master of Computer Applications, Paavai Engineering College, Namakkal, Tamilnadu, India, He is Masters in Computers Applications. Having 18+ years of experience and his area of interest is Java, JSP, Servlet, J2EE, C#, PHP, Python ASP.NET, SQL Server and etc.