Notification texts go here Contact Us Buy Now!

Complete the code segment to find the largest among three numbers x y and z You should use if-then-else construct in Java

Complete the code segment to find the largest among three numbers x y and z You should use if-then-else construct in Java

Complete the code segment to find the largest among three numbers x y and z  You should use if-then-else construct in Java

import java.util.Scanner;  

public class Exercise1_2 {

       public static void main(String[] args) {

Scanner s = new Scanner(System.in); 

        int x = s.nextInt(); 

        int y = s.nextInt();

int z = s.nextInt();

int result = 0;

//Use if...else ladder to find the largest among 3 numbers and store the largest number in a variable called result.

//Use if...else ladder to find the largest among 3 numbers and store the largest number in a variable called result.

if(x>y && x>z)

{

  result=x;  

}

else if(y>x && y>z)

{

result=y;    

}

else

{  

result=z;  

}

 System.out.print(result);

 }

}



wap to implement medium filter matlab program

Post a Comment

Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.