Module PerNum_inBetween Sub main() Dim min, max, p, sum, r As Integer Console.Write("Enter a minimum number= ") min = CInt(Console.ReadLine()) Console.Write("Enter a maximum number= ") max = CInt(Console.ReadLine()) Console.WriteLine("Perfect Numbers are:- ") While min <= max p = 1 sum = 0 While p < min r = min Mod p If r = 0 Then sum += p End If p += 1 End While If sum = min Then Console.WriteLine(min.ToString) End If min += 1 End While Console.ReadLine() End Sub End Module
Visual Basic dot net VB.net programming microsoft .net framework object oriented language network enabled technology visual basic 2005 IDE integrated development environment console application microsoft cre common runtime environment
Find Perfect Numbers within a range
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment