WAP to find smallest among two numbers.

1 year ago
OOP Java

Compile code:

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

Output:

0
Dipti KC
Jan 8, 2023
More related questions

Questions Bank

View all Questions