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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T05:23:07+00:00 2026-06-03T05:23:07+00:00

im doing this simple for and i get this error. When i change TRUE

  • 0

im doing this simple for and i get this error. When i change TRUE to FALSE it doesnt give that error, but the test real error… but i need the test to pass and i dont understand.. can anybody help? C# visual studio 2010 NUnit

[Test]

public void prueba1()
{

    List<int> lista1 = new List<int>();

    lista1.Add(1);

    lista1.Add(2);

    lista1.Add(3);

    for (int i = 0; i < lista1.Count; i++)
    {

        Console.WriteLine(lista1[i]);
        Assert.True(lista1[i]<lista1[i+1]);

    }
  • 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-03T05:23:09+00:00Added an answer on June 3, 2026 at 5:23 am

    The valid indexes into your list are 0 through 2.lista1.Count will be 3, so i goes from 0 to 2. When i is 2, you try to access lista1[i+1], which is out of range.

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

Sidebar

Related Questions

I know this probably really simple but Im not sure what im doing wrong...
This is a seemingly simple problem but I am having trouble doing it in
I am using Delphi, but this is a simple and general problem: I'm doing
I'm doing a simple check for some user data that get's put into session
I'm having difficulty doing this seemingly simple task. I want to load XML files
Is there a simple way of doing this I found this online and I
I am doing very simple int division and I am getting odd results. This
Im doing this project where i need to download files through a webservice (images,
I am doing this on Fedora Problem: (sandbox)[root@localhost mysite]# django-admin.py runserver Error: Could not
I am doing this first time so I need some help. I am 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.