•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Java section within the Software Development category of DaniWeb, a massive community of 426,862 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,242 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Java advertiser: Lunarpages Java Web Hosting
Views: 1147 | Replies: 4
![]() |
•
•
Join Date: Apr 2004
Posts: 555
Reputation:
Rep Power: 6
Solved Threads: 5
Hello,
I am having a problem with %. I am trying to find all the years from 1628 to 2005 that are divisible by 15, so I did this:
So the way i am thinking of this is that year will be divided by 15 and if it is divided evenly then it would have a remainder of 0. So is there something wrong with the way I am using the % or is it something else that I am not seeing.
TY
I am having a problem with %. I am trying to find all the years from 1628 to 2005 that are divisible by 15, so I did this:
if((year % 15 == 0) || (year % 100 == 0) || (year == 2005)){ System.out.println("Print something");
}So the way i am thinking of this is that year will be divided by 15 and if it is divided evenly then it would have a remainder of 0. So is there something wrong with the way I am using the % or is it something else that I am not seeing.
TY
•
•
Join Date: Aug 2005
Location: Socialist Republic of Boulder
Posts: 216
Reputation:
Rep Power: 4
Solved Threads: 6
•
•
Join Date: Oct 2004
Location: San Francisco, CA
Posts: 338
Reputation:
Rep Power: 4
Solved Threads: 2
![]() |
•
•
•
•
•
•
•
•
DaniWeb Java Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Installing Windows 98 On VMware. Floppy problem (Windows 9x / Me)
- Windows XP keeps restarting since a new video card (Windows NT / 2000 / XP / 2003)
- Redhat Linux 6.2 - ipop3d problem? (*nix Software)
- Problem with T720 (Gadgets and Gizmos)
- Connection Problems (Networking Hardware Configuration)
- Encoding (Unicode) problem in IE 6.0 (Web Browsers)
- .htaccess mod_rewrite problem (Linux Servers and Apache)
- Javascript/HTML problem!!! (JavaScript / DHTML / AJAX)
- Problem with Windows Update and WinXP (Web Browsers)
Other Threads in the Java Forum
- Previous Thread: how to run applets?
- Next Thread: image via java


Linear Mode