Computer Science, asked by SP5, 7 months ago

Write a java program to print 1, if the input is 0.​

Answers

Answered by faatimafyz
1

Answer:

class Number

{

void accept(int n)

{

System.out.println("Enter a number="+n);

if(n==0)

System.out.println("1");

else

System.out.println("Wrong input");

}

}

Similar questions