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