Back to Browse

java program to check number is positive or negative using conditional operator

951 views
Premiered Sep 16, 2021
5:48

In this video you will learn how to check that a number is positive or negative using conditional operator. Example: import java.util.Scanner; class PositiveNegative { public static void main(String[]args) { Scanner kb=new Scanner(System.in); int n; System.out.println("Enter an integer : "); n=kb.nextInt();//-10 System.out.println(n>=0?"Positive Integer":"Negative Integer"); } } www.tarunsir.com www.cinstitute.org.in Connect me on linkedin https://www.linkedin.com/in/tarrunverrma https://www.instagram.com/the_ultimate_coding_stuff/ #tarunsir #javatutorial #learnprogramming #conditionaloperator #positivenegative

Download

1 formats

Video Formats

360pmp47.6 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

java program to check number is positive or negative using conditional operator | NatokHD