Given an integer, how could you check if it contains a 0, using Java?
1 = Good 2 = Good ... 9 = Good 10 = BAD! 101 = BAD! 1026 = BAD! 1111 = Good
How c
You can convert it to a string and check if it contains the char "0".
int number = 101; if( ( "" + number ).contains( "0" ) ) { System.out.println( "contains the digit 0" ); }