Skip to main content

Posts

Showing posts from June, 2020

Write a program in Java to find out the second smallest digit of a given number without using arrays

Question: Write a program in Java to find out the second smallest digit of a given number without using arrays. Welcome to Programming Questions !!!. In this post, I will share the code to find out the second smallest digit of a given number without using the array. This question is frequently asked in google question hub, so in this post, you will get its solution. Sample Input 1: Enter Number Here --> 5281036974 Sample Output 1: The Second Smallest number is 1 Sample Input 2: Enter Number Here --> 333 Sample Output 2: All digits of the given number are same, hence there is no second smallest number Solution code: import   java.util . Scanner ; public   class   secondSmallest  {      public   static   void   main ( String []  args ) {          Scanner   in  =  new   Scanner ( System . in );      ...