Computer Science, asked by SP5, 6 months ago

WAP that if the input is 0 , then the output should be 1 in java.​

Answers

Answered by aayushthakur3105
0

Answer:

import java.util.*;

import java.util.scanner;

class Program

{

public static void main(String args[])

{

Scanner sc=new Scanner(System.in);

int i=sc.nextInt();

Stirng s=i>0?"0":"1":

System.out.println(s);

}

}

Similar questions