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

Forum

Log In Sponsors
Partner Sites
Board index Programming Visual Basic Forum

VB programming issue

Moderator: dafunkymunky

VB programming issue

Postby cbsfn1345 on Sat Jan 24, 2009 9: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 9:11 pm

Re: VB programming issue

Postby White95dp on Mon Mar 09, 2009 2: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 1:52 am


Return to Visual Basic Forum

Who is online

Users browsing this forum: No registered users and 0 guests