Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

has 8 digit in number

public bool hasEight(int number)
{
      while(number > 0)
      {
        // we can check any num instead of 8
          if(number % 10 == 8){
              return true;
          }
          number=number/10;
      }
      return false; 
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #digit #number
ADD COMMENT
Topic
Name
1+6 =