From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,2ac407a2a34565a9 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.218.166 with SMTP id ph6mr13784747pbc.5.1330462032547; Tue, 28 Feb 2012 12:47:12 -0800 (PST) Path: h9ni20240pbe.0!nntp.google.com!news1.google.com!news.glorb.com!feeder.erje.net!news2.arglkargh.de!news.swapon.de!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: Array Help? Date: Tue, 28 Feb 2012 21:47:10 +0100 Organization: A noiseless patient Spider Message-ID: <87mx828z3l.fsf@ludovic-brenta.org> References: <10615783-d4a9-4cbd-8971-53ba1100d6a0@b18g2000vbz.googlegroups.com> Mime-Version: 1.0 Injection-Info: mx04.eternal-september.org; posting-host="zPMLJ9oy2+Gdj0DQyhc3OA"; logging-data="12232"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/ukaPAVrFo1AjHcQaGQz0v" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) Cancel-Lock: sha1:iggQmhVr/j0eSDDLsSrj4Gr3BB0= sha1:2vvDQkk++WDcgNU3wgczb8m5owk= Content-Type: text/plain; charset=us-ascii Date: 2012-02-28T21:47:10+01:00 List-Id: Will writes on comp.lang.ada: > Hello all, > > I am looking for your help again. I know how to refer to a certain > index in an array. for example if some array A is (53,83,3,62,3,13) > then A(4) = 62 but what if I wanted to go through an array and > identify certain indexes by what they contain? In my particular case > I need to identify the indexes that have numbers in them that do not > end in 1 or 2. These numbers range from 1 to 4 digits. Any ideas on > how I can do this? > > Thanks a bunch Since this looks very much like a school assignment, my answer will be in English rather than Ada :) Traverse the array. Each element in the array is an integer; take that integer modulo 10. If the integer modulo 10 is neither 1 nor 2 then output the index of the element (or add that index to a vector of indexes for further processing). HTH -- Ludovic Brenta.