Android Question For Loop Statement

Jimpin23

New Member
For Loop statement that loops the numbers from 1-100 and determines all numbers Divisible by 3. Is my code correct?
Sub bt1_Click
Dim Num,Res As Int
Num = 0
Res = 0
For Loop Res
Res = Num % 3
Num = Num + 1
Loop
Bt1.Text = “Done”
End Sub

Just beginner hehe
 

Alex_197

Well-Known Member
Licensed User
Longtime User
Why don't save "time and money" by using
Loop:
For i=0 To 100 Step 3
   Log(i)
Next

In this code you don't have to waste your time on useless iterations.

So you will get

0
3
6
and so on
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…