write a program to input two number and check whether both are divisible by 5
Answers
Answered by
0
class ab
{
void main (int a,int b)
{ int c,d;
c= a%5==0;
d=b%5==0;
{System.out.println("divisible by 5");}}}
{
void main (int a,int b)
{ int c,d;
c= a%5==0;
d=b%5==0;
{System.out.println("divisible by 5");}}}
Answered by
0
import java.util.*;
class u
{
public static void main (String args[ ])
{
Scanner sc=new Scanner (System.in);
System.out.println("please give number");
int a=sc.nextInt ();
int b;
b=a%5;
if(b==0)
{
System.out.println("Yes it is divisible by 5");
}
if else (b!=0)
{
System.out.println("It is not divisible by 5")
}
}
}
class u
{
public static void main (String args[ ])
{
Scanner sc=new Scanner (System.in);
System.out.println("please give number");
int a=sc.nextInt ();
int b;
b=a%5;
if(b==0)
{
System.out.println("Yes it is divisible by 5");
}
if else (b!=0)
{
System.out.println("It is not divisible by 5")
}
}
}
Similar questions
Computer Science,
7 months ago
Biology,
7 months ago
Science,
7 months ago
Computer Science,
1 year ago
Social Sciences,
1 year ago