Computer Science, asked by dibyendu16, 9 months ago

write a java program to test whether number is divisible by 7 or not ?

Answers

Answered by rajan521
6

Answer:

please mark as briliant answer

_____________________________

Java Program to Check Whether Given Number is Divisible by 5

public class Check_Divisiblity.

int n;

Scanner s = new Scanner(System.

System. out. print("Enter any number:");

n = s. nextInt();

if(n % 5 == 0)

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

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

Answered by sushiladevi4418
12

Answer:

Java program to check wether the number is divisible by 7 or not.

Explanation:

/ Java Program to Check whether Number is Divisible by 5 and 11

import java.util.Scanner;

public class Divisibleby5and11 {

private static Scanner sc;

public static void main(String[] args)  

{

int number;

sc = new Scanner(System.in);

 System.out.print(" Please Enter any Number to Check whether it is Divisible by 7: ");

number = sc.nextInt();  

if((number % 7 == 0)  

{

System.out.println("\n Given number " + number + " is Divisible by 7");  

}

else {

System.out.println("\n Given number " + number + " is Not Divisible by 7");  

}  

}

}

Similar questions