How to Use Structer in Console Application?
By Goniey N (Mr. G)
Use Of Structure In Console Application...
Structure student
Dim rollno, m1, m2, m3, tot As Integer
Dim per As Double
Dim name As String
End Structure
Sub Main()
Dim s(1) As student
Dim i As Integer
For i = 1 To 1
Console.WriteLine("Enter the Roll Number of Student:=>")
s(i).rollno
= Console.ReadLine()
Console.WriteLine("Enter the Name of Student:=>")
s(i).name
= Console.ReadLine()
Console.WriteLine("Enter the Marks of First Subject:=>")
s(i).m1
= Console.ReadLine()
Console.WriteLine("Enter the Marks of Second Subject:=>")
s(i).m2
= Console.ReadLine()
Console.WriteLine("Enter the Marks of Third Subject:=>")
s(i).m3
= Console.ReadLine()
s(i).tot
= s(i).m1 + s(i).m2 + s(i).m3
Console.WriteLine("Roll No:=>" & s(i).rollno)
Console.WriteLine("Name:=>" & s(i).name)
Console.WriteLine("Total:=>" & s(i).tot)
s(i).per
= s(i).tot / 3
Console.WriteLine("Percentage:=>" & s(i).per)
Next i
Console.ReadLine()
End Sub
How to Use Structer in Console Application? (667 Views)