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 1046503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T16:09:21+00:00 2026-05-16T16:09:21+00:00

adding value together. so: 1 + 0 = 1 3 + 1 = 4

  • 0

adding value together.

so:

1 + 0 = 1

3 + 1 = 4

4 + 4 = 8

How do I get this, so that it starts off at 0, and i type in 1 into a txtbox, so it adds 1 to the total, next i type in 3, so it adds 3 to the total, which eqauls 4, now i type 4, and it adds 4 to the total, which means its at 8 now.

How do i write the code to keep adding to its self?

  • 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-05-16T16:09:22+00:00Added an answer on May 16, 2026 at 4:09 pm

    That sounds like homework, so I’ll put the answer on a level so I don’t give you the answer, but rather point out a direction.

    The core problem is that you will need to store the value, so that it is available when you want to add the next number to it. If you declare a local variable inside a method, it gets initialized each time the method runs. So instead you will need to hold the value somewhere outside of the method, such as in a class field. Then you can simply add the value from the text box to the field by

    1. Reading the string from the text box
    2. Converting the string to a numerical type (such as int)
    3. Add the number to the total stored in the class field
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have javascript function that automatically adds input fields together, but adding numbers like
I’m adding a total amount value to a DIV through a jQuery Ajax call
I'm dynamically adding value of an input tag. The values are returned from the
After adding the key value pairs in NSMutableDictionary, when i retrive the key/values from
I want to update a column by adding a new value alongside the old
What, if any, is the accepted way of adding a key-value pair from ASP.NET/JavaScript
I am trying to add a key value pair and having trouble adding the
How to securely store usernames in database, without adding them directly to cookie value?
I ran into my first compiler that changes the lvalue passed to ::delete, but
I'm trying to get the MAX on a column which is generated dynamically using

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.