BZU PAGES: Find Presentations, Reports, Student's Assignments and Daily Discussion; Bahauddin Zakariya University Multan

BZU PAGES: Find Presentations, Reports, Student's Assignments and Daily Discussion; Bahauddin Zakariya University Multan (http://bzupages.com/)
-   Visual Programming (http://bzupages.com/237-visual-programming/)
-   -   Factorial Program (by Ahmad Mushtaq) (http://bzupages.com/f237/factorial-program-ahmad-mushtaq-7336/)

!!Ahmad Mushtaq!! 20-12-2009 12:52 PM

Factorial Program (by Ahmad Mushtaq)
 
Factorial Program


Code:

Module Module1
 
      Sub Main()
          Dim input As Integer
          Dim result As Double
 
          Console.WriteLine("Please input your value for factorial")
          input = Console.ReadLine
 
          result = calculateFactorial(input)
 
          Console.WriteLine(result)
          Console.Read()
 
      End Sub
 
      Function calculateFactorial(ByVal number As Integer) As Double
          Dim factorial As Double = 1.0
          For i As Double = 1.0 To number
              factorial = factorial * i
          Next
          Return factorial
      End Function
 
  End Module


BSIT07-01 21-12-2009 12:03 AM

Re: Factorial Program (by Ahmad Mushtaq)
 
But that isn't the program that was assigned to Ahmad by Sir. Ahsan...

!!Ahmad Mushtaq!! 21-12-2009 02:14 AM

Re: Factorial Program (by Ahmad Mushtaq)
 
sorry bro! That was one of the program! I'm facing some internet connectivity problems... Going to upload them now! Just wait


All times are GMT +5. The time now is 04:12 PM.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.