Math, asked by laxmidevi814101, 6 months ago

write a program input in java any number and check number is odd or even (using conditional operator).​

Answers

Answered by ms1699534
0

Answer:

Stffhut hey ur FFF yyyeycsyD

Answered by shreeshail2005
0

Answer:Import java.util scanner

public class Kboat conditional operator

{

public static void main(string args[ ])

{

num=int(input("enter a number:"))

if num > 1:

for i in range(2,num):

if (num % i) == 0:

print(num,"is not a prime number")

print(i,"times",num//i,"is",num)

break

else:

print(num,"is a prime number")

# if input number is less than

# or equal to 1, it is not prime

else:

print(num,"is not a prime number")

Step-by-step explanation:

Similar questions