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

  • Home
  • SEARCH
  • 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 7855765
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T20:29:11+00:00 2026-06-02T20:29:11+00:00

How can I populate an array or list with sums that don’t go higher

  • 0

How can I populate an array or list with sums that don’t go higher than 10?
I could do this with 3 arrays where 2 of them hold random numbers which the answer is not higher than 10, and a 3rd array to have the answers in it.

But that’s kind of an ugly way of doing this.

To be more clear with what I want:

1 + 1 = 2
5 + 5 = 10
3 + 2 = 5

etc etc

The user only gets to see the 1 + 1 at first. And when the time is up, the user gets to see the answer.

So does anyone has another solution then what I’m about to tryout?

  • 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-02T20:29:12+00:00Added an answer on June 2, 2026 at 8:29 pm

    Most likely you are trying to do something like this. This compiled but is untested. Noted how to create these pairs using the random number generator and subtraction.

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    
    namespace ConsoleApplication1
    {
        class Program
        {
    
            struct addition_pairs{
                public int first;
                public int second;
            }
    
            static void Main(string[] args)
            { 
    
             List<addition_pairs> main_list;
             main_list = new List<addition_pairs>();
           //TODO call populate_list and choose how many sets you want.
    
            }
    
            private void populate_list(int how_many, List<addition_pairs> list)
            {
                for (int i = 0; i < how_many; i++)
                {
                    Random random = new Random();
                    int randomNumber1 = random.Next(0, 10);
                    addition_pairs insert = new addition_pairs();
                    insert.first = randomNumber1;
                    insert.second = random.Next(0, 10-randomNumber1);
                    list.Add(insert);
                }
    
            }
        }
    }
    

    EDIT: FIXED so it doesn’t add to 10 every time LOL. I passed math i promise

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

if i have an array. can i populate a generic list from that array:
The problem is that I can't find a way to properly populate boxes array.
Can anybody tell me how to populate an Expandable List with Array List of
How can i populate an array in loop? I'd like to do something like
How can I populate multiple datagrids in flex with a single datasource that is
How can I do this in Javascript/jQuery from PHP? I am trying to populate
**Have it working now. I forgot to populate the Array List. How embarrassing. I'm
This is/isn't homework...the printing of the list IS homework and that works great, the
i have this problem: as i can add list to one list? i have
How can I convert a List to an Array in Java? Check the code

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.