how to code this using the ?: operation. Output is in brackets | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 1

how to code this using the ?: operation. Output is in brackets

Enter amount: (100000) Enter the term in years: (1) Rate = 2.5 Interest in year 1 $2500.0

9th Feb 2019, 3:52 AM
czarina smsn
czarina smsn - avatar
1 Antwort
+ 7
? : is a ternary operator. Same like if-else statements. int i=3; if (i>2){ System.out.print("hi"); } else{ System.out.print("no"); } shorthand. System.out.print( i>2? "hi": "no");
9th Feb 2019, 4:32 AM
Muhd Khairul Amirin
Muhd Khairul Amirin - avatar