Module Module1
Sub Main()
For student As Integer = 1 To 5
Dim sum As Integer = 0
Console.WriteLine("Enter marks for student {0}", student)
For subject As Integer = 1 To 5
Console.Write("Enter mark for subject {0}: ", subject)
Dim mark As Integer
Integer.TryParse(Console.ReadLine(), mark)
sum += mark
Next
Console.WriteLine(vbNewLine + "Sum: {0}", sum)
Dim average As Double = sum / 5.0
Console.WriteLine("Average: {0}", average.ToString("N"))
Console.WriteLine()
Next
Console.ReadLine()
End Sub
End Module
Comments
Leave a comment