Conditional Operator in Java

Conditional Operator in Java

Conditional Operator in Java


conditional operator in java,conditional operator in java example,java if condition with and operator,ternary conditional operator java,conditional ternary operator java


Conditional operator

import java.io.*;
class arun
{
public Static void main(String args[]) throws IOException
{
DataInputStream in = new DataInputStream(System.in);
{
int a,b,c;
System.out.println("Enter the value of a and b is:");
a=Integer.parseInt(in.readLine());
b=Integer.parseInt(in.readLine());
c=a>b?a:b;
System.out.println("The value of c is:"+c);
}
}

Post a Comment

0 Comments