• Breaking News

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

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

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


    import java.util.Scanner;


    public class Smallest
    {
      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 Smallest.");
        else if (y < x && y < z)
          System.out.println("Second number is Smallest.");
        else if (z < x && z < y)
          System.out.println("Third number is Smallest.");
        else
          System.out.println("The numbers are not distinct.");
      }
    }
     

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

    Enter three integers
    12, 14, 16
    First number is Smallest.

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

    3 comments: