Need a simple looping program help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • halo combat22
    New Member
    • Oct 2007
    • 24

    Need a simple looping program help

    I need to create a program that asks the user for the beginning and ending numbers in a range. The computer will then display the sum of the entire range. For example: if the user inputted 2 and 5, the program would display 14 as the sum of the range ( 2 + 3 + 4 + 5).

    ty, any help is appreciated
  • muddasirmunir
    Contributor
    • Jan 2007
    • 284

    #2
    first made there text boxes
    text1 and text2 for giving range and text3 for displaying result
    and try this code on click event of the button


    dim a,b,c,d as double
    a=text1.text
    b=text2.text
    d=0
    for c=a to b
    d=d+c
    next c

    text3.text=d

    Comment

    • halo combat22
      New Member
      • Oct 2007
      • 24

      #3
      tyvm, it really helped :)

      Comment

      Working...