Computer Science, asked by rexina2418, 1 month ago

WRITE A PROGRAM TO CHECK ENTERED NUMBER IS DIVISIBLE BY 5 OR NOT

Answers

Answered by kamalrajatjoshi94
1

Answer:

Program:-

import java.util.*;

public class Number

{

public static void main(String args[ ])

{

Scanner in=new Scanner(System.in);

int n;

System.out.println("Enter the number");

n=in.nextInt();

if(n%5==0)

System.out.println(n + " is divisible by 5");

else

System.out.println(n + " is not divisible by 5");

}

}

Similar questions