private static void findPowerOfValue(int findValue, int powerValue) {
int temp = 0;
while (findValue > powerValue) {
temp = findValue / powerValue;
if ((temp % powerValue) != 0) {
System.out.println("Given value : "+findValue+" is not power of "+powerValue);
break;
} else {
System.out.println("Given value : "+findValue+" is power of "+powerValue);
}
findValue = findValue / powerValue;
}
}
int temp = 0;
while (findValue > powerValue) {
temp = findValue / powerValue;
if ((temp % powerValue) != 0) {
System.out.println("Given value : "+findValue+" is not power of "+powerValue);
break;
} else {
System.out.println("Given value : "+findValue+" is power of "+powerValue);
}
findValue = findValue / powerValue;
}
}
No comments:
Post a Comment