Input A Number and Check Whether All Digits Are Even or Not Using While Loop in Java Dremendo
Input A Number and Check Whether All Digits Are Even or Not Using While Loop in Java Dremendo
Program
Copy
import java.util.Scanner;
while(n>0)
{
d=n%10;
if(d%2==0)
{
ed=ed+1; // counti
}
td=td+1; // counti
n=n/10;
}
if(td==ed)
{
System.out.println("All digit
}
else
{
System.out.println("All digit
}
}
Output
Previous Next
···
Our Courses
C Tutorial
C++ Tutorial
Java Tutorial
Python Tutorial
HTML Tutorial
CSS Tutorial
News Updates
!
©Do you
2024 like cookies?
Dremendo. We use cookies to ensure
All Rights Reserved.
you get the best experience on our website.
Pricing Refund and Cancellation About Us
Contact PrivacyLearn
Policymore
Terms I agree