Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8777243
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T19:14:05+00:00 2026-06-13T19:14:05+00:00

So the program has to add all the numbers from x to y. But

  • 0

So the program has to add all the numbers from “x” to “y”.

But it also has to display all the numbers added :

i.e. 10 to 20 should display 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 = 165

Here’s what I have:

Dim firstnum As Integer = Val(TextBox1.Text)
    Dim secondnum As Integer = Val(TextBox2.Text)
    Dim sum As Integer = 0


    While firstnum <= secondnum

        sum = sum + firstnum
        firstnum = firstnum + 1

        Label3.Text = firstnum & "+"

    End While


    suum.Text = "  =  " & Val(sum)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T19:14:07+00:00Added an answer on June 13, 2026 at 7:14 pm

    With the following:

    Label3.Text = firstnum & "+"
    

    You are overwriting the value in Label3 every time you go through the loop. What you probably want to do is concatenate the existing value with the next number.

    This should get you on your way:

    Label3.Text = Label3.Text & firstnum & " + "
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a program made basically from a ListCtrl and has an add button,
I am writing a program to print out all the numbers from 0 to
I have the following program to remove even numbers from a string vector, when
My program has one dialog and two sockets. Both sockets are derived from CAsyncSocket,
If a program has literally just deserialized an object (doesn't really matter how, but
The data model in my program has a number of discrete states, but I
I have searched for hours but could not find anything similar. The crash has
I'm working on a program that will allow me to multiply/divide/add/subtract binary numbers together.
Lets say I have a server program that can accept connections from 10 (or
i have a program to list the students , it can add new one

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.