Quantcast
Channel: VBForums - CodeBank - Visual Basic 6 and earlier
Viewing all articles
Browse latest Browse all 1489

[VB6]Code for greater number from 10 values entered by the user using for next loop

$
0
0
I need to make a program for finding out the greater number among 10 numbers, that are entered by the user using only for.. next loop. This is the code I'm using but it isn't working:
Dim a, b, c As Integer
a = 0
For b = 1 To 10
c = InputBox("Enter a number")
a = a + c
If a > c Then
a = c
End If
Next b
MsgBox ("The greatest value = " & a)

Viewing all articles
Browse latest Browse all 1489

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>