Find out Factorial number of given number
Module Module1
Dim a, i As Integer
Dim fact As Integer
Sub Main()
Console.WriteLine("enter the number")
a = Console.ReadLine()
fact = 1
i = 1
For i = 1 To a
fact = fact * i
Next i
Console.WriteLine("factorial is" & fact)
Console.ReadLine()
End Sub
End Module
Module Module1
Dim a, i As Integer
Dim fact As Integer
Sub Main()
Console.WriteLine("enter the number")
a = Console.ReadLine()
fact = 1
i = 1
For i = 1 To a
fact = fact * i
Next i
Console.WriteLine("factorial is" & fact)
Console.ReadLine()
End Sub
End Module
0 comments: