Computer Science, asked by MolikJoshi, 3 months ago

Write a program to input an integer and using ternary operator check whether it is a

multiple of 5 or not.​

Answers

Answered by CopyThat
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