WAP to find smallest among three numbers.

3 years ago
OOP Java

Compile code:

class Smallestnumberofthreenumbers{
public static void main(String[] args) {
        
      int a = 5, b = 15,c=30;
      if(a<b&&a<c)
     System.out.println("Smallest numbers is: "+a);
      else if(b<a&&b<c)
     System.out.println("Smallest numbers is: "+b);
     else
     System.out.println("Smallest numbers is: "+c);
    
   }
}

Output:

0
Dipti KC
Jan 8, 2023
More related questions

Questions Bank

View all Questions