Answer to Question #18377 in Visual Basic for devisree
using do loop until sum up to limit program and factorial numbers
1
2012-11-13T07:49:12-0500
Module Module1
Sub Main()
Dim N, Nfact, Count, hold As Double
Console.Write("Please input a number to be factored: ")
N = Convert.ToDouble(Console.ReadLine)
Count = N
Console.WriteLine(Count)
If N = 0 Then
Console.WriteLine("The factor of 0 is 1")
Exit Sub
End If
Do Until Count = 1
Nfact = Count * (Count - 1)
Count -= 1
Console.WriteLine(Count)
Console.WriteLine("Nfact =" & Nfact)
Loop
Console.WriteLine("the factor of {0} is {1}", N, Nfact)
End Sub
End Module
Need a fast expert's response?
Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!
Comments
Leave a comment