
-----------------------------------
nelsonkkyy
Thu Oct 22, 2009 9:39 am

Help! Turing
-----------------------------------
Write a Turing program that will store intergers in an array until -99999 is entered.  The program will then display all of the odd numbers entered and calculate the average of the odd numbers.  Use strintok to ensure that the user enters only integers.

Can Someone help me?? I have no idea to make the odd number and sum and average.

-----------------------------------
nelsonkkyy
Thu Oct 22, 2009 2:48 pm

RE:Help! Turing
-----------------------------------
Someone help me?

-----------------------------------
SNIPERDUDE
Thu Oct 22, 2009 3:33 pm

Re: Help! Turing
-----------------------------------
First of all, please don't double post.

Second, for odd numbers you will want to look at the mod function (which gives you the remainder of anything divided.

So for example:
5 mod 2
will give you 110 mod 2
will give you 0, etc.

When you want to find out if a number is odd, you would mod the number by two.  If it results in 0, it is even.  Resulting in one means the number is odd.

-----------------------------------
nelsonkkyy
Thu Oct 22, 2009 3:55 pm

RE:Help! Turing
-----------------------------------
so how do write in array?

-----------------------------------
SNIPERDUDE
Thu Oct 22, 2009 5:13 pm

Re: Help! Turing
-----------------------------------
The Turing Walkthrough should have any topic you wish to explore.
