#13 Mastering Java | Ternary Operator Explained | Java Tutorial Series | EMC Academy

  Рет қаралды 27,035

Error Makes Clever

Error Makes Clever

Күн бұрын

Пікірлер: 87
@PreethiPriyadharshini369
@PreethiPriyadharshini369 4 ай бұрын
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); }
@afsara8154
@afsara8154 2 ай бұрын
Your comment is use full for me Thanks lots 👏🏻❤🎉
@itzsuman45
@itzsuman45 Ай бұрын
a & b kum same value kodutha "b is greater" nu varumae adha epdi solve pannuving terrnory operator la?
@mohamedarsath4455
@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-dv1pe
@SivaV-dv1pe 4 ай бұрын
String result4=(num1>num2)?num1+" is greater than "+num2:num2+" is greater than "+num1;
@ragavendrar4735
@ragavendrar4735 4 ай бұрын
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-wk7ph
@Akash-wk7ph 5 ай бұрын
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);
@faizal2634
@faizal2634 4 ай бұрын
thanks bro
@freefiregamers-nk5xs
@freefiregamers-nk5xs 3 ай бұрын
Thanks bro
@serialkiller9278
@serialkiller9278 5 ай бұрын
Bro I am complete 💯✅
@Dhakshina_Moorthy
@Dhakshina_Moorthy 5 ай бұрын
I completed Bro Upload MySQL Full course
@snoozed1113
@snoozed1113 3 ай бұрын
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-yu7ro9uy4w
@user-yu7ro9uy4w 2 ай бұрын
Int to string line between we use scan. next line() ;
@karthikeyansivalingam5740
@karthikeyansivalingam5740 2 ай бұрын
brooo data structures and alogrithms needed brooo
@nvsbflims4624
@nvsbflims4624 4 ай бұрын
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); } }
@thirupathimariyappanm3617
@thirupathimariyappanm3617 3 ай бұрын
Crt
@suthimj3604
@suthimj3604 2 ай бұрын
{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");
@varunjoseph7294
@varunjoseph7294 4 ай бұрын
very useful bro.. Apdiye Java with selenium webdriver and cucumber BDD framework with POM videos panunga bro romba usefull ah irukum
@sravanibodapati1585
@sravanibodapati1585 16 күн бұрын
String result= a>b ? "a is greater than b" : " b is greater than a "; System.out.println(result);
@Lucky-dm7wb
@Lucky-dm7wb 2 ай бұрын
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
@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"); } }
@nivethasri1107
@nivethasri1107 3 ай бұрын
Why the notes document is not accessible????
@BaraniPrakasam
@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
@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-kj9kl
@haasinis-kj9kl 3 ай бұрын
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"); } }
@HareeshkarRavi
@HareeshkarRavi 2 ай бұрын
Is this working for you ? I think this correct down 👇 Int result = num1>num2?"num1":"num2"; System.out.print(result + "is greater");
@AishwaryaLakshmi15
@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); } }
@gthought7933
@gthought7933 20 күн бұрын
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); }}
@vijayashreegunasekaran5292
@vijayashreegunasekaran5292 8 күн бұрын
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-nk5xs
@freefiregamers-nk5xs 3 ай бұрын
// 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
@adheeeful
@adheeeful 4 күн бұрын
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); } }
@soundaryadamotharan8183
@soundaryadamotharan8183 4 ай бұрын
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); } }
@ashik7522
@ashik7522 2 күн бұрын
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! 😅
@Anukarthik17
@Anukarthik17 4 ай бұрын
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
@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-rg7dv
@KeerthiKeerthi-rg7dv 2 ай бұрын
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
@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); } }
@pachaiyappans582
@pachaiyappans582 3 ай бұрын
int a=10; int b=20; String greater=a>b?"a is greater":"b is greater"; System.out.println(greater);
@ManoKarthikeyan-x4m
@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
@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); } }
@asbsulaiman3572
@asbsulaiman3572 4 ай бұрын
Haii. Bro digital marketing explore panuga
@madhanarjun4767
@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
@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-kw9rz
@AVK-kw9rz 3 күн бұрын
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
@GOKULV-u8s Ай бұрын
Bro all the system.out.print syntax we use brackets.but in this concept we didn't use that why??
@HealingVibes-vv7yr
@HealingVibes-vv7yr 2 ай бұрын
complete anna🎉
@yogicandy2114
@yogicandy2114 2 ай бұрын
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
@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); : }
@harikeshchandraganesh1935
@harikeshchandraganesh1935 3 ай бұрын
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-dz3ge
@Visvaram-dz3ge 3 ай бұрын
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);
@sangeethaajay3515
@sangeethaajay3515 18 күн бұрын
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);
@nandhanageetha2077
@nandhanageetha2077 5 ай бұрын
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-uw4jf
@NaveenKumar-uw4jf 4 ай бұрын
yes, possible ,you can concatenate the result into the statement using +
@aaditz47
@aaditz47 3 ай бұрын
String result = (n1>n2?"n1":"n2"); s.o.pln(result);
@Prakash-gf2mx
@Prakash-gf2mx 2 ай бұрын
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"); } }
@thesandyff0
@thesandyff0 29 күн бұрын
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); } }
@ramyachitra8814
@ramyachitra8814 4 ай бұрын
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
@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
@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.arshadahamed6229
@m.m.arshadahamed6229 4 ай бұрын
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.m3480
@gayathri.m3480 5 ай бұрын
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_edits
@r33epo_edits 3 ай бұрын
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"); } }
@nithiyashree8668
@nithiyashree8668 2 ай бұрын
Anna unga tutorials la padikurathu and practice mattum pothuma anna endha interview uh pass pannira mudiyuma solunga anna
@Ady_NXT
@Ady_NXT Ай бұрын
Nope ithu basics tha hackerank antha mari website la practice pannunga
@MohamedAslam-sm7xm
@MohamedAslam-sm7xm 5 ай бұрын
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.d3203
@durairaj.d3203 3 ай бұрын
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-l6c9y
@Akash-l6c9y 5 ай бұрын
Complete
@pramilaprami3767
@pramilaprami3767 4 ай бұрын
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);
@buvaneshkishore4850
@buvaneshkishore4850 4 ай бұрын
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_19
@Jeez_19 3 ай бұрын
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); } }
@BasuthanValavan
@BasuthanValavan 3 ай бұрын
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
@sudhansudhan9802 Ай бұрын
boolean a=(10
@sivamurugan9420
@sivamurugan9420 2 ай бұрын
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.t
@Raja.b.t 5 ай бұрын
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
@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
@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); } }
@28nelvieshwillson79
@28nelvieshwillson79 4 ай бұрын
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); } }
@krishharish506
@krishharish506 3 ай бұрын
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); } }
@pavithraraju9689
@pavithraraju9689 4 ай бұрын
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_Gowtham
@Code_With_Gowtham 4 ай бұрын
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); } }
@Shaswath7766
@Shaswath7766 26 күн бұрын
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
@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); } }
@sportszone3466
@sportszone3466 5 ай бұрын
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); } }
@CCUSENTHILKUMARANR
@CCUSENTHILKUMARANR 2 ай бұрын
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); } }
@Riotkeshav5954
@Riotkeshav5954 23 күн бұрын
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
@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); } }
@dariekurkes
@dariekurkes 4 ай бұрын
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); } }
Фейковый воришка 😂
00:51
КАРЕНА МАКАРЕНА
Рет қаралды 7 МЛН
An Unknown Ending💪
00:49
ISSEI / いっせい
Рет қаралды 44 МЛН
Logical Operators in Java
6:19
Neso Academy
Рет қаралды 64 М.
The Ultimate Python Programming Roadmap Before you Start🐍 in Tamil
6:05
Let Us Code Together
Рет қаралды 6 М.
Siddhu's Special Japan Chicken😋✨ | Japan Ep- 8 | Vj Siddhu Vlogs
19:11
Vj Siddhu Vlogs
Рет қаралды 1,9 МЛН
Object Oriented Programming - The Four Pillars of OOP
11:23
Keep On Coding
Рет қаралды 334 М.