Program to tests whether the given number is divisible by 3 and 5, both

/* Program to tests whether the given number is divisible by 3 and 5, both */

class Divby3_5
{
    public static void main(String args[])
    {
        int no ;
        no = 15;
       
        if (no%3 == 0)
                  if (no%5 == 0)
                       System.out.println("The number "+no+" is divisible by 3 and 5");
    }
}
       

0 comments:

Post a Comment

 
 
 
 


Copyright © 2012 http://codeprecisely.blogspot.com. All rights reserved |Term of Use and Policies|