Write a program to input an integer and using ternary operator check whether it is a
multiple of 5 or not.
Answers
Answered by
5
Program: {JAVA}
import java.util.*;
public class Brainly
{
static void main()
{
Scanner sc=new Scanner(System.in);
int n;
System.out.print("Enter an integer: ");
n=sc.nextInt();
System.out.println((n%5==0)?"Multiple of 5":"Not a multiple of 5");
}
}
Similar questions
Math,
1 month ago
Social Sciences,
1 month ago
Math,
3 months ago
English,
9 months ago
History,
9 months ago