You are on page 1of 1

Practical No :16

Name :Shubham Kanodje


Roll No :65
Input:

Module Module1
Function Add()
Dim a, b, c As Integer
Console.WriteLine("Enter First Number :")
a = Console.ReadLine()
Console.WriteLine("Enter Second Number :")
b = Console.ReadLine()
c=a+b
Console.WriteLine("Addition =" & c)
Return 0
End Function
Function sum(ByVal a As Integer, ByVal b As Integer)
Return a + b
End Function
Function facto(ByVal num As Integer)
If num = 0 Then
Return 1
Else
Return (num * facto(num - 1))

End If
End Function
Sub Main()
Add()
Dim a, b, c, fact, f As Integer
Console.WriteLine("Enter First Number :")
a = Console.ReadLine()
Console.WriteLine("Enter Second Number :")
b = Console.ReadLine()
c = sum(a, b)
Console.WriteLine("Addition =" & c)
Console.WriteLine("Enter To Calculate Factorial :")
f = Console.ReadLine()
fact = facto(f)
Console.WriteLine("Factorial =" & fact)
Console.ReadLine()
End Sub

End Module

Output:

You might also like