I would like for the boundary variable to increment every time the program
goes inside of the if statement in the printCount method-- in this way
boundary will stop the for loop in main when boundary reaches 199.
If you see anything wrong with my code, please let me know. Thanks!
public class Emirp
{
public static void main(String[] args)
{public static String reverse(String s, int index)
int i = 0;
int iReverse = 0;
int boundary = 0;
for(i = 13; boundary < 200; i++)
{}
String s = "";
iReverse = 0;
s = Integer.toString(i);
int index = s.length();
reverse(s, index);
iReverse = Integer.parseInt(reverse(s,index));
}
{
if (index > 0)public static boolean isPrime(int integer)
{
return s.charAt(--index) + reverse (s, index);}
else
return "";
}
{
for(int value = (integer - 1); value > 1; value--)}
{
if (integer % value == 0)return true;
{}
return false;
}
public static void printCount(int original, int reversed)
{
if(isPrime(original) && isPrime(reversed))}
{}
System.out.print(original + " ");
main.boundary++;
}