public class Ternary { public static void main(String[] args) { Scanner scan=new Scanner(System.in); int a=scan.nextInt(); int b=scan.nextInt(); String result=(a>b)?"A is greater":"B is greater"; System.out.println(result); }
@afsara81542 ай бұрын
Your comment is use full for me Thanks lots 👏🏻❤🎉
@itzsuman45Ай бұрын
a & b kum same value kodutha "b is greater" nu varumae adha epdi solve pannuving terrnory operator la?
@mohamedarsath4455Ай бұрын
@@itzsuman45 import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); System.out.print(a > b ? "a is greater" : (b > a ? "b is greater" : "both are equal")); } } //first we need to check whether a is big so i use a>b ? "a greater" and we use : this collon refer else type so in that condition we check (b>a ? "b is big" : "both are equal")) i hope you understand
@SivaV-dv1pe4 ай бұрын
String result4=(num1>num2)?num1+" is greater than "+num2:num2+" is greater than "+num1;
@ragavendrar47354 ай бұрын
Bro completed import java.util.Scanner; public class demo { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int a = scan.nextInt(); int b = scan.nextInt(); String result = a>b? "A is greater than b" : "b is greater than a"; System.out.println(result); } }
@Akash-wk7ph5 ай бұрын
Scanner scan = new Scanner(System.in); int a = scan.nextInt(); int b = scan.nextInt(); String result = a>b? "A is greater than b" : "b is greater than a"; System.out.println(result);
@faizal26344 ай бұрын
thanks bro
@freefiregamers-nk5xs3 ай бұрын
Thanks bro
@serialkiller92785 ай бұрын
Bro I am complete 💯✅
@Dhakshina_Moorthy5 ай бұрын
I completed Bro Upload MySQL Full course
@snoozed11133 ай бұрын
import java.util.Scanner; class number{ public static void main(String args[]) { Scanner scan = new Scanner(System.in); System.out.print("Enter Number 1: "); int num1=scan.nextInt(); System.out.print("Enter Number 2: "); int num2=scan.nextInt(); String result=(num1>num2)?num1+ "is greater than "+num2:num2+" is greater than "+num1; System.out.print(result); } }
@user-yu7ro9uy4w2 ай бұрын
Int to string line between we use scan. next line() ;
@karthikeyansivalingam57402 ай бұрын
brooo data structures and alogrithms needed brooo
@nvsbflims46244 ай бұрын
Sir is this answer correct import java.lang.System; import java.util.Scanner; class one { public static void main(String[] args) { Scanner hello = new Scanner(System.in); System.out.println("Enter A..."); int a = hello.nextInt(); System.out.println("Enter B..."); int b = hello.nextInt(); String value = a > b ? "A is greater than B" : "B is greater than A"; System.out.println(value); } }
@thirupathimariyappanm36173 ай бұрын
Crt
@suthimj36042 ай бұрын
{Scanner scan =new Scanner (System.in); int a =scan.nextInt(); int b =scan.nextInt(); System.out.print(a>b? "A is greater" : "B is greater");
@varunjoseph72944 ай бұрын
very useful bro.. Apdiye Java with selenium webdriver and cucumber BDD framework with POM videos panunga bro romba usefull ah irukum
@sravanibodapati158516 күн бұрын
String result= a>b ? "a is greater than b" : " b is greater than a "; System.out.println(result);
@Lucky-dm7wb2 ай бұрын
import java.util.Scanner; public class inputTernary { public static void main(String args[]){ Scanner scan = new Scanner(System.in); System.out.println("Enter i1 : "); Integer i1=scan.nextInt(); System.out.println("Enter i2 : "); Integer i2=scan.nextInt(); String result=(i1>i2)?"i1 is greater than i2":"i2 is greater than i1"; System.out.println(result); } }
@mohamedarsath4455Ай бұрын
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int a=sc.nextInt(); int b=sc.nextInt(); System.out.print(a>b?"a is greater":"b is greater"); } }
@nivethasri11073 ай бұрын
Why the notes document is not accessible????
@BaraniPrakasamАй бұрын
int a=5; int b=3; String result=a>b?"a is greater than b":"b is greater than a"; System.out.println(result);
@DeepakKumar-k1l7uАй бұрын
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int num1 = scan.nextInt(); int num2 = scan.nextInt(); String result = num1>num2? "num1 is greater":"num2 is greater"; System.out.print(result);
@haasinis-kj9kl3 ай бұрын
import java.util.Scanner; class hello { public static void main(String args[]) { System.out.println(" \t Program to check the greatest of 2 numbers"); Scanner scan = new Scanner(System.in); System.out.print("Enter number 1: "); int num1 = scan.nextInt(); System.out.print("Enter number 2: "); int num2 = scan.nextInt(); int result = num1 > num2 ? num1 : num2; System.out.println(result + " is the greatest number"); } }
@HareeshkarRavi2 ай бұрын
Is this working for you ? I think this correct down 👇 Int result = num1>num2?"num1":"num2"; System.out.print(result + "is greater");
@AishwaryaLakshmi15Ай бұрын
import java.util.Scanner; public class a { public static void main(String args[]) { Scanner scan=new Scanner(System.in); int num1=scan.nextInt(); int num2=scan.nextInt(); String result=num1>num2 ?num1 +" is greater than "+ num2:num2 +" is greater than "+ num1; System.out.print(result); } }
@gthought793320 күн бұрын
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); System.out.println("give me number 1"); long num1 = scan.nextLong(); System.out.println("give me number 2"); long num2 = scan.nextLong(); System.out.println(num1>num2?"num1 is grater "+num1:"num2 is grater "+num2); }}
@vijayashreegunasekaran52928 күн бұрын
import java.util.Scanner; class demo{ public static void main(String args[]) { Scanner scan=new Scanner(System.in); int a=scan.nextInt(); int b=scan.nextInt(); String result=a>b?"a is greater":"b is greater"; System.out.println(result); } }
@freefiregamers-nk5xs3 ай бұрын
// Online Java Compiler // Use this editor to write, compile and run your Java code online import java.util.Scanner; class HelloWorld { public static void main(String[] args) { Scanner guru = new Scanner (System.in); int num1 = guru.nextInt(); int num2 = guru.nextInt(); String result = (num1
@adheeeful4 күн бұрын
import java.util.Scanner; class thala{ public static void main(String[]args){ Scanner simbu=new Scanner(System.in); System.out.print("Enter the value of a:"); int a = simbu.nextInt(); System.out.print("Enter the value of b:"); int b = yuga.nextInt(); String result = a>b?"a is greatest number":"b is greatest number"; System.out.print(result); } }
@soundaryadamotharan81834 ай бұрын
import java.util.Scanner; public class Learn2 { public static void main(String[] args) { Scanner scan= new Scanner(System.in); System.out.println("Enter a value: "); int a=scan.nextInt(); System.out.println("Enter b value: "); int b=scan.nextInt(); String result=(a>b)?"a is greater":"b is greater"; System.out.println(result); } }
@ashik75222 күн бұрын
public class emc_codes { public static void main(String[] args) { Scanner n=new Scanner(System.in); System.out.print("give motha number raa!"); int muthal_number=n.nextInt(); System.out.print("give rendavathu number raa!"); int rendavathu_number=n.nextInt(); String got=muthal_number>rendavathu_number?"amanga ayya muthal number thanuga persu":"illadoi rendavathu number thambla persu!"; System.out.println(got); n.close(); } } //sorry guys if its not funny! 😅
@Anukarthik174 ай бұрын
import java.util.scanner; Scanner scan=new scanner(system.in); System.out.println("Enter the number a":); int a= scan.nextInt(); System.out.print("Enter the number b":); int b= scan.nextInt(); greater=(a>b?"a":"b"); System.out.print(greater, "number is greater" );
@DevadharshiniDd-wm9clАй бұрын
class HelloWorld { public static void main(String[] args) { int num1=5; int num2=2; String result=(num1>num2)?"num1 is greater":"num2 is greater"; System.out.print(result); } }
@KeerthiKeerthi-rg7dv2 ай бұрын
class HelloWorld { public static void main(String[] args) { int a=5; int b=4; String result=a>b?"a is greater":"b is greater"; System.out.println(result); } }
@nandhinigopu6384Ай бұрын
import java.util.Scanner; public class nan{ public static void main(String args[]){ Scanner sc=new Scanner(System.in); int a=sc.nextInt(); int b=sc.nextInt(); String result=a>b? "a is greater":"b is greater"; System.out.println(result); } }
@pachaiyappans5823 ай бұрын
int a=10; int b=20; String greater=a>b?"a is greater":"b is greater"; System.out.println(greater);
@ManoKarthikeyan-x4mАй бұрын
import java.util.Scanner; class ternaryoperator { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int a = scan.nextInt(); int b = scan.nextInt(); System.out.print(a>b?"A is Greater":"B is Greater"); } }
@nallarasu5085Ай бұрын
import java.util.Scanner; class hello { public static void main(String[] args) { Scanner thanu = new Scanner(System.in); System.out.println("enter the value of a:"); int a = thanu.nextInt(); System.out.println("enter the value of b:"); int b = thanu.nextInt(); String result = (a>b)?"a is greater":"b is greater"; System.out.println(result); } }
@asbsulaiman35724 ай бұрын
Haii. Bro digital marketing explore panuga
@madhanarjun4767Ай бұрын
import java.util.Scanner; class hello{ public static void main(String args[]) { Scanner scan = new Scanner(System.in); int a = scan.nextInt(); int b = scan.nextInt(); String result = a>b?"A is Greater":"B is Greater"; System.out.print(result); } }
@gamingsan-1Ай бұрын
import java.util.Scanner; class c{ public static void main(String arg[]){ Scanner n=new Scanner(System.in); int i1=n.nextInt(); int i2=n.nextInt(); String sk =i1>i2? "i1 is greater":"i2 is greater"; System.out.println(sk); } }
@AVK-kw9rz3 күн бұрын
import java.util.Scanner; class hello{ public static void main (String arg []) { System.out.println("hello World"); Scanner scan=new Scanner(System.in); int num=scan.nextInt(); int num1=scan.nextInt(); String c=num>num1?num+" max":num1+" max"; System.out.println(c); } }
@GOKULV-u8sАй бұрын
Bro all the system.out.print syntax we use brackets.but in this concept we didn't use that why??
@HealingVibes-vv7yr2 ай бұрын
complete anna🎉
@yogicandy21142 ай бұрын
mport java.util.Scanner; class j{ public static void main(String args[]) { Scanner yogi=new Scanner(System.in); int num1=yogi.nextInt(); int num2=yogi.nextInt(); String result=num1>num2?"num1 is greater than num2":"num2>num1"; System.out.print(result);
@devdeva8949Ай бұрын
import java.lang.System; import java.util.Scanner; class Q4_02{ public static void main(String args[]) { Scanner scan = new Scanner(System.in); { } System.out.println("Enter the num1"); int A = scan.nextInt(); { System.out.println("Enter the num2"); } int B = scan.nextInt(); int result (A>B)?A:B; { System.out.println("THE BIGGEST NUM IS" ); System.out.print(result); : }
@harikeshchandraganesh19353 ай бұрын
import java.util.Scanner; class ternop{ public static void main(String args[]){ Scanner scan = new Scanner(System.in); int a = scan.nextInt(); int b = scan.nextInt(); String number=(a>b)?"A is greater and right":"Its wrong"; System.out.println(number); } }
@Visvaram-dz3ge3 ай бұрын
Scanner scan = new Scanner(System.in); System.out.println("Enter the two numbers"); int a = scan.nextInt(); int b = scan.nextInt(); String number = a>b? "a is greater number" : "b number is greater"; System.out.println(number);
@sangeethaajay351518 күн бұрын
Scanner scan= new Scanner(System.in); System.out.println("type number 1"); int n1= scan.nextInt(); System.out.println("type number 2"); int n2= scan.nextInt(); String num= n1>n2?"number 1 is greater":"number 2 is greater"; System.out.println(num);
@nandhanageetha20775 ай бұрын
While printing the output is that possible that we can print for ex: 20 is greater than 10 because it is printing as just a is greater and b is greater ..?? We need to print the exact number what we give as input ?
@NaveenKumar-uw4jf4 ай бұрын
yes, possible ,you can concatenate the result into the statement using +
@aaditz473 ай бұрын
String result = (n1>n2?"n1":"n2"); s.o.pln(result);
@Prakash-gf2mx2 ай бұрын
import java.util.Scanner; class ternaryopp { public static void main(String[] args) { Scanner scan = new Scanner(System.in); System.out.print("Enter first number"); int a=scan.nextInt(); System.out.print("Enter second number"); int b=scan.nextInt(); System.out.println(a>b?"first number greater then second number":"second number is greader then first number"); } }
@thesandyff029 күн бұрын
import java.util.Scanner; import java.lang.System; class ternary{ public static void main(String args[]) { Scanner scan = new Scanner(System.in); int a,b; System.out.print("Enter the 1st number: "); a=scan.nextInt(); System.out.print("Enter the 2nd number: "); b=scan.nextInt(); String c =a>b?"a is greater":"b is greater"; System.out.println(c); } }
@ramyachitra88144 ай бұрын
import java.util.Scanner; class demo{ public static void main(String args[]){ Scanner Scan=new Scanner (System.in); int a = Scan.nextInt(); int b = Scan.nextInt(); String result = a>b? "a is greater than b":" b is greater than a"; System.out.printf(result); } }
@SundarN-v3uАй бұрын
import java.util.Scanner; class hello{ public static void main(String[] args) { Scanner scan=new Scanner(System.in); System.out.print("enter a value:"); int a=scan.nextInt(); System.out.println("enter b valu:"); int b=scan.nextInt(); boolean great=a>b; System.out.print("solution:"); String result=great?"yes":"no"; System.out.println(result); } }
@aktharhanfi6053Ай бұрын
public class hello { public static void main(String[] args) { Scanner a=new Scanner(System.in); System.out.print("Enter a 1st number:"); int num1=a.nextInt(); System.out.print("Enter a 2nt number:"); int num2=a.nextInt(); String r=num1>num2?"num1 a Greater-then num2":"num2 a Greater-then num1"; System.out.print(r); } }
@m.m.arshadahamed62294 ай бұрын
import java.util.*; public class Main { public static void main (String args[]) { Scanner input = new Scanner(System.in); int num1 = 10; int num2 = 20; String num = (num1 > num2 ? "true" : "false"); System.out.println(num); } }
@gayathri.m34805 ай бұрын
import java.util.Scanner; class demo{ public static void main(String args[]){ Scanner scan=new Scanner (System.in); int num1=scan.nextInt(); int num2=scan.nextInt(); System.out.print(num1>num2?"Number 1 is greater":"Number 2 is greater"); } }
@r33epo_edits3 ай бұрын
Import Java.util.Scanner; class emc{ public static void main(String args[]) { Scanner scan=new Scanner(System. in); int num1=scan.nextInt(); int num2=scan.nextInt(); String result=(num1>num2)?"num1>":"num2"; System.out.println(result); System.out.prinln("thank you John anna"); } }
@nithiyashree86682 ай бұрын
Anna unga tutorials la padikurathu and practice mattum pothuma anna endha interview uh pass pannira mudiyuma solunga anna
@Ady_NXTАй бұрын
Nope ithu basics tha hackerank antha mari website la practice pannunga
@MohamedAslam-sm7xm5 ай бұрын
import java.util.Scanner; public class Ternary_Operator { public static void main(String[] args) { // TODO Auto-generated method stub Scanner input = new Scanner(System.in); System.out.println("Input a number for Variable \"A\""); int a = input.nextInt(); System.out.println("Input a number for variable \"B\""); int b = input.nextInt(); String result = a>b? "\"A\" is greater than B" : "\"B\" is greater than \"A\" "; System.out.println(result); } } Or can be directly printed like===> System.out.println(a>b? "\"A\" is greater than B" : "\"B\" is greater than \"A\" ");
@durairaj.d32033 ай бұрын
import java.util.Scanner; class q8{ public static void main(String []args) { Scanner scan=new Scanner(System.in); int num1=scan.nextInt(); int num2=scan.nextInt(); String rainfall = num1>num2?"num1 than greater num2":"num2 is greater than num1"; System.out.println(rainfall); } }
@Akash-l6c9y5 ай бұрын
Complete
@pramilaprami37674 ай бұрын
Scanner s=new Scanner(System.in); System.out.println("Enter num1:"); int num1=s.nextInt(); System.out.println("Enter num2:"); int num2=s.nextInt(); String result =num1>num2?"num1 is Greater than num2":"num2 is Greater than num1"; System.out.println(result);
@buvaneshkishore48504 ай бұрын
Scanner input = new Scanner(System.in); System.out.println("Enter the num1 "); int num1 = input.nextInt(); System.out.println("Enter the num2 "); int num2 = input.nextInt(); System.out.println("The num1 is "+ num1); System.out.println("The num2 is "+ num2); String High_value = (num1>num2)?"num_1 is greater":"num_2 is greater"; System.out.println(High_value);
@Jeez_193 ай бұрын
import java.util.Scanner; class Helloworld{ public static void main(String args[]) { Scanner sc= new Scanner(System.in); System.out.println("enter num1:"); int num1=sc.nextInt(); System.out.println("enter num2:"); int num2=sc.nextInt(); int result=num1>num2?num1:num2; System.out.println("The greatest among the given two numbers:"); System.out.print(result); } }
@BasuthanValavan3 ай бұрын
import java.util.Scanner; public class game { public static void main(String[] args) { @SuppressWarnings("resource") Scanner scanner = new Scanner(System.in); System.out.print("Num1: "); int num1 = scanner.nextInt(); System.out.print("Num2: "); int num2 = scanner.nextInt(); String result = num1>num2?"Num1 is greater than Num2":"Num2 is greater than Num1"; System.out.println(" "+result); } }
@sudhansudhan9802Ай бұрын
boolean a=(10
@sivamurugan94202 ай бұрын
import java.util.Scanner; class ternary{ public static void main(String args[]) { Scanner scan=new Scanner(System.in); int a=scan.nextInt(); int b=scan.nextInt(); String c=a>b?"a is greater":"b is greater"; System.out.print(c); } }
@Raja.b.t5 ай бұрын
import java.util.Scanner; public class TernaryGreater { public static void main(String[] args) { Scanner in=new Scanner(System.in); System.out.println("Enter a value A : "); int A=in.nextInt(); System.out.println("Enter a value B : "); int B=in.nextInt(); System.out.println(A>B?A+" is greater":B+" is greater"); } }
@leo__crushАй бұрын
import java.util.Scanner; class hii{ public static void main(String args[]){ Scanner scan = new Scanner(System.in); System.out.println("ENTER THE A VALUE:"); int a = scan.nextInt(); System.out.println("ENTER THE B VALUE:"); int b = scan.nextInt(); System.out.println("The Result is:"); String result = (a>b)? "A is greater": "B is greater"; System.out.println(result); } }
@vichu6382Ай бұрын
import java.util.*; class HelloWorld { public static void main(String[] args) { Scanner scan = new Scanner (System.in); int a= scan.nextInt(); int b= scan.nextInt(); String result = a>b ? " A is greater then" : " B is greater " ; System.out.print(result); } }
@28nelvieshwillson794 ай бұрын
import java.util.Scanner; public class tern { public static void main(String args[]) { int a, b; System.out.println("Enter the numbers"); Scanner ua = new Scanner(System.in); a = ua.nextInt(); b = ua.nextInt(); String v = a > b ? a + " is greater" : b + "is greater"; System.out.println(v); } }
@krishharish5063 ай бұрын
import java.util.Scanner; class coding{ public static void main(String args[]) { Scanner scan =new Scanner(System.in); Double a = scan.nextDouble(); Double b =scan.nextDouble(); String Result = (a>b)?"A is greater":"B is greater"; System.out.print(Result); } }
@pavithraraju96894 ай бұрын
import java.util.*; public class Greater { public static void main(String args[]){ Scanner ac = new Scanner (System.in); System.out.println("Enter num1:"); int num1 = ac.nextInt(); System.out.println("Enter num2:"); int num2 = ac.nextInt(); int result = (num1>num2)?num1:num2; System.out.println(result); } }
@Code_With_Gowtham4 ай бұрын
import java.util.*; class HelloWorld { public static void main(String[] args) { Scanner sc =new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); String num1 = a >= b? "a is greater than b" : "B is greater then a"; System.out.println(num1); } }
@Shaswath776626 күн бұрын
import java.util.Scanner; public class op { public static void main(String[] args) { Scanner scan=new Scanner(System.in); int a =scan.nextInt(); int b =scan.nextInt(); String result=a>b?"a is greater":"b is greater"; System.out.print(result); } }
@vasigara9051Ай бұрын
import java.util.Scanner; class hello{ public static void main(String arg[]) { Scanner scan = new Scanner(System.in); int a = scan.nextInt(); int b = scan.nextInt(); String num = a>b?"a is greater than b":"b is greater than a"; System.out.print(num); } }
@sportszone34665 ай бұрын
import java.util.*; public class Main{ public static void main(String args[]){ Scanner sc = new Scanner(System.in); int num1 = sc.nextInt(); int num2 = sc.nextInt(); String result = num1>num2?"num 1 is greater":"num2 is greater"; System.out.print(result); } }
@CCUSENTHILKUMARANR2 ай бұрын
import java.util.Scanner; class HelloWorld { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int num1 = scan.nextInt(); int num2 = scan.nextInt(); String result = num1>num2? "num1 is greater":"num2 is greater"; System.out.print(result); } }
@Riotkeshav595423 күн бұрын
import java.util.Scanner; public class Ternary { public static void main(String[] args) { Scanner scan=new Scanner(System.in); System.out.println("Enter the A value: "); int a=scan.nextInt(); System.out.println("Enter the B value: "); int b=scan.nextInt(); System.out.println((a>b)?"A is greater":"B is greater"); } }
@DHANAJEYAHEMANTH.BАй бұрын
import java.util.*; class ternary{ public static void main(String[] args) { Scanner scan = new Scanner(System.in); System.out.println("Enter first number"); int num1 = scan.nextInt(); System.out.println("Enter second number"); int num2 = scan.nextInt(); String res = num1>num2?"Greater":" Smaller"; System.out.println(res); } }
@dariekurkes4 ай бұрын
import java.util.Scanner; public class study_6 { public static void main(String arg[]) { Scanner scan= new Scanner(System.in); System.out.println("Enter the first number:"); int num1=scan.nextInt(); System.out.println("Enter the Second: "); int num2=scan.nextInt(); String result= num1>num2?"first is Greater":"Second is greater"; System.out.println(result); } }