import java.util.*;
class ternary
{
public static void main (String arg[])
{
Scanner in = new Scanner (System.in);
int a,b,c;
System.out.print ("\n\t Enter first number = ");
a=in.nextInt();
System.out.print ("\n\t Enter second number = ");
b=in.nextInt();
a==b ? c=1:c=5;
System.out.println ("\n\t c = "+c);
}
}
Note:
After entering values, in the above program, computer will check that whether 'a' is equal to 'b' or not. If 'a' is equal to 'b' than
- c = 1 will be displayed
No comments:
Post a Comment