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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:32:27+00:00 2026-05-26T05:32:27+00:00

I have an array where the index starts at 0. I am attempting to

  • 0

I have an array where the index starts at 0. I am attempting to determine how I find specific items in array.

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

I only want 2,6,10,14. If it wasn’t a 0-index array I could do a modulus%3 on the index and get what I want but I cannot figure out how to do it.

    string[] arr = new string[16];
    arr[0] = "data";
    arr[1] = "data";
    arr[2] = "data";
    arr[3] = "data";
    arr[4] = "data";
    arr[5] = "data";
    arr[6] = "data";
    arr[7] = "data";
    arr[8] = "data";
    arr[9] = "data";
    arr[10] = "data";
    arr[11] = "data";
    arr[12] = "data";
    arr[13] = "data";
    arr[14] = "data";
    arr[15] = "data";
    for (int i = 0; i < arr.Length; ++i)
    {
        if (i % 3 == 0)
        {
            Console.WriteLine(arr[i]);
            Console.ReadLine();
        }
    }
    Console.ReadLine();

This of course doesn’t work for me and I’ve tried manipulating ‘i’ but I just haven’t had enough coffee yet today to get it to work.

  • 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-26T05:32:28+00:00Added an answer on May 26, 2026 at 5:32 am

    It looks like you want

    if(i % 4 == 2)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

hi i have multidimensional array in php i want to remove an index from
I have values in some array I want to re index the whole array
I have an array that doesn't use the 0 index. The array starts from
Is it possible to start an array at an index not zero...I.E. you have
I have an array for instance, Array { 3.0 at Index 0 2.0 at
I have a bit array implementation where the 0th index is the MSB of
i have this JSON: var projects_array = new Array( {name:myName1, id:myid1, index:1}, {name:myName2, id:myid2,
I have an array of pixel data in a JSON object. I'm attempting to
I have an ArrayList of type String . I want to determine whether any
I have an array of integers, which could run into the hundreds of thousands

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.