write an algorithm and a flowchart to check your input number is divisible by 11 or not.
Answers
Answered by
1
Answer:
import java.util.*;
public class Main
{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.print("Enter a number:");
int n = sc.nextInt();
if(n % 11 == 0){
System.out.println(n + " is divisible by 11");
}
else{
System.out.println(n + " is not divisible by 11");
}
}
}
Explanation:
Similar questions