Monday, January 26, 2009

How to create Factorial using vb6.0?

















Private Sub Command1_Click()


Dim x As Integer
Dim ctr As Integer
ctr = 1

For x = 1 To Val(Text1.Text)

ctr = ctr * x

Next x

Label1.Caption = "Factorial of " & Text1.Text & " is" & ctr


End Sub

Download File

8 comments:

  1. bulok ng program mu gago....

    ReplyDelete
  2. no problem... ako malaki problema q sau...!!!!

    puro debug...

    ReplyDelete
  3. its giving error while finding fact of 10

    ReplyDelete
  4. 10 is too large to fit in integer

    Dim x As Long
    Dim ctr As Long

    ReplyDelete
  5. can you explain why is that program like that?

    ReplyDelete
  6. how to write print button coding in vb6.0 when i am clicking on print button generating the report and print saved items using printer .

    please help me ,i am developing hotel billing project ,please send source code to my mail address
    suresh84.a@gmail.com

    ReplyDelete

 

blogger templates | Make Money Online