Computer Science, asked by Aditi9402, 1 year ago

write a program to input two number and check whether both are divisible by 5

Answers

Answered by ayushburnitdown619
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");}}}
Answered by AnshJaaiswalAj
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")
}
}
}
Similar questions