• Breaking News

    তিনটি সংখ্যার মধ্যে বড় সংখ্যা বের করার জাভা প্রোগ্রাম

    তিনটি সংখ্যার মধ্যে বড় সংখ্যা বের করার জাভা প্রোগ্রাম


    প্রোগ্রামের সোর্স কোড-


    import java.util.Scanner;


    public class Largest
    {
      public static void main(String args[])
      {
        int x, y, z;
        System.out.println("Enter three integers");
        Scanner in = new Scanner(System.in);

        x = in.nextInt();
        y = in.nextInt();
        z = in.nextInt();

        if (x > y && x > z)
          System.out.println("First number is largest.");
        else if (y > x && y > z)
          System.out.println("Second number is largest.");
        else if (z > x && z > y)
          System.out.println("Third number is largest.");
        else
          System.out.println("The numbers are not distinct.");
      }
    }
     


    প্রোগ্রামটি রান করলে যে আউটপুট পাবো তা হলো:

    Enter three integers
    12, 14, 16
    Third number is largest.

    পরবর্তী প্রোগ্রাম- 

    1 comment: