//Application of Conditional statement
import java.util.*;
class Prog
{
public static void main(String args[ ] )
{
Scanner ob=new Scanner(System.in);
int x,y;
System.out.print("Enter the numbers:");
x=ob.nextInt( );
y=ob.nextInt( );
if(x = =y)
System.out.println("Both numbers are equal");
if(x>y)
System.out.println(x+"is largest");
else
System.out.println(y+" is largest");
}
}
import java.util.*;
class Prog
{
public static void main(String args[ ] )
{
Scanner ob=new Scanner(System.in);
int x,y;
System.out.print("Enter the numbers:");
x=ob.nextInt( );
y=ob.nextInt( );
if(x = =y)
System.out.println("Both numbers are equal");
if(x>y)
System.out.println(x+"is largest");
else
System.out.println(y+" is largest");
}
}
This comment has been removed by the author.
ReplyDeleteI'm Spandan Biswas of 8th standard.
ReplyDeleteOk
Delete