# Thread: I can't figure this out

1. Member
Join Date
Jul 2007
Posts
35
Rep Power
0

## I can't figure this out

I Write an application that calculates the prduct of the odd integers from 1 to 15.
That is all it says...does it mean multiply all the odd numbers from 1 to 15? If so how do i do this....im not sure how to point out negative numbers.
Thanks

2. Are worried about multiplying negative odd numbers?

int can hold negative numbers at all.

3. Senior Member
Join Date
Jul 2007
Posts
130
Rep Power
0
calculates da products of odd numbers from 1-15?

products in da mathematical terms of multiplication u mean rite?
so i supposed u want to make it like this?

1x3x5x7x9x11x13x15 = ?

if u wanna get da odd number from 1 - 15, u could use da modulus operator %, a loop, and an if logical statement

da main method should look like this inside i think

Java Code:
```    int x = 1;
for(int i=1;i<=15;i++)
{
if((i%2)==1)//meaning that its an odd number
{
x = i*x;//or u could just write it x*=i to make it short, but its not really a good idea if ur still stufying, itll give u some hard time reading n doin ur logic
}
}```
btw, just in case it didn't work, make sure u put da code inside da main method k, i already tested da code n it run out just fine :D

logic comes first, coding comes later :p
hope this helps sylvia:D

4. Design comes first.:p

Originally Posted by cruxblack
logic comes first, coding comes later :p

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•