It is also possible to use one ternary operator inside another ternary operator. It is called the nested ternary operator in C++. Here's a program to find whether a number is positive, negative, or zero using the nested ternary operator. #include<iostream>#include<string>usingnamespacestd;int...
Example: Java Ternary Operator importjava.util.Scanner;classMain{publicstaticvoidmain(String[] args){// take input from usersScanner input =newScanner(System.in); System.out.println("Enter your marks: ");doublemarks = input.nextDouble();// ternary operator checks if// marks is greater than ...