Results 1 to 3 of 3
  1. #1
    rockstaedy is offline Member
    Join Date
    Sep 2012
    Posts
    8
    Rep Power
    0

    Default why this no work

    //Write a program that prints out every number divisible by 16 between
    //151 and 1081. Get the average of this set.

    int count1=151; //counter start point

    do{ double b = count1 % 16; //modulous by 16 to check for remainder
    if (b==0.0); //if there is no remainder
    {
    System.out.println(count1); //print the number the counter is on
    }count1++; //increment the counter
    }
    while(count1<=1081); //end point for the counter
    ################################################
    the output
    ################################################
    151
    152
    153
    154
    155
    156
    etc...
    i know i spelled my user name wrong oops

  2. #2
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,001
    Blog Entries
    7
    Rep Power
    20

    Default Re: why this no work

    Quote Originally Posted by rockstaedy View Post
    Java Code:
            if (b==0.0);                            //if there is no remainder
    What is that semi colon doing there?

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    rockstaedy is offline Member
    Join Date
    Sep 2012
    Posts
    8
    Rep Power
    0

    Default Re: why this no work

    thanks now she works im a dope for simple mistakes just like me username thanks

Similar Threads

  1. Why. Does. This. Not. Work.
    By Kaytes in forum New To Java
    Replies: 1
    Last Post: 04-06-2012, 07:50 PM
  2. applet call dll work in Win2000 but not work in WinXP
    By manhcuongtin4 in forum Java Applets
    Replies: 1
    Last Post: 07-14-2011, 01:45 PM
  3. Getting SWT app to work on a different OS
    By Ravioli in forum SWT / JFace
    Replies: 0
    Last Post: 02-20-2011, 09:35 AM
  4. Cant seem to get this to work
    By nivekeleets in forum Java 2D
    Replies: 4
    Last Post: 11-13-2010, 07:09 PM
  5. how would i get this to work...?
    By deeadeed in forum New To Java
    Replies: 6
    Last Post: 12-06-2007, 02:58 AM

Posting Permissions

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