namespace
sturctexample
{
public
struct branch_details
{
public string branch_name;
public int strength;
public string head_of_department;
public string topper_of_branch;
};
class
structure
{
static void Main(string[]
args)
{
branch_details obj =
new branch_details();
obj.branch_name =
"computer science and engineering";
obj.strength = 100;
obj.head_of_department = "Mr. john";
obj.topper_of_branch
= "fernandis";
Console.WriteLine("Branch
name is {0}", obj.branch_name);
Console.WriteLine("Strength of branch is {0}", obj.strength);
Console.WriteLine("Head of department is {0}",
obj.head_of_department);
Console.WriteLine("Topper of the Branch is {0}",
obj.topper_of_branch);
Console.Read();
}
}
}
The struct branch_details holds
related data namely: branch_name,strength,head_of_department, and
topper_of_branch which are of various data types.