It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming Visual Basic Forum

VB programming issue

Moderator: dafunkymunky

VB programming issue

Postby cbsfn1345 on Sat Jan 24, 2009 8:16 pm

How can I code a program that will raise the base to the power of a specified exponent without using the ^ operator? Maybe using loops?
cbsfn1345
 
Posts: 1
Joined: Sat Jan 24, 2009 8:11 pm

Re: VB programming issue

Postby White95dp on Mon Mar 09, 2009 1:37 am

Dim i As Long
Dim j As Long
Dim k As Long
j = 1
k = Val(Text1.Text)
For i = 1 To k - 1
k = k * Val(Text1.Text)
Next
Label2.Caption = k
White95dp
 
Posts: 7
Joined: Mon Mar 09, 2009 12:52 am


Who is online

Users browsing this forum: No registered users and 3 guests