Answer:
public class Digits
{
public static boolean allDigitsOdd(int num)
{
boolean flag=true;
int rem;
while(num>0)
{
rem=num%10;
num=num/10;
if(rem%2==0) // if a even digit found immediately breaks out of loop
{
flag=false;
break;
}
}
return flag; //returns result
}
public static void main(String args[])
{
System.out.println(allDigitsOdd(1375)); //returns true as all are odd digits
}
}
OUTPUT :
true
Explanation:
Above program has 2 static methods inside a class Digits. Logic behind above function is that a number is divided by 10 until it is less than 0. Each time its remainder by 0 is checked if even immediately breaks out of the loop.
The needed syntax would be:
<!--comment-->
Hope I could be of assistance! ;)
Answer:
Machine Learning and/or Artificial Intelligence (AI)
Both in my personal and professional life, I use the Excel software in order to create tables and lists. It's much easier to do that in Excel rather than in Word, for example, because Excel was actually created for that purpose, whereas Word was created for writing, above all. I use Excel for work to create tables of various things, such as names, emails, payments, etc. whereas I use it in my personal life to create lists of things such as movies, books, etc.