السلام عليكم
كتبت كود في الجافا بسيط وادخلت FOR داخل IF و العكس صحيح :)
لكن يظهر لي ان FOR دائرة مفتوح ولا يغلق البرنامج رغم اني واضع القيم الصحيحه !!
public class binary
{
public static void main(String arg[])
{
String al;
int a,b=8,c=9,i,g=0;
al = JOptionPane.showInputDialog ("Enter Number");
a = Integer.parseInt(al);
if(a%2==0)
{
System.out.println("Binary");
}
else
{
System.out.println("frdi");
}
for (i=0;i<12;i++)
{
c = c + 1;
c= c%2;
if (c==0)
{
for(i=0;i<3;i++)
{
g = g +3;
System.out.println("=================");
System.out.println(g);
if(g%2==1)
{
System.out.println("2");
for(i=0;i<3;i++)
{
int s=4;
s++;
if(s>=2)
{
System.out.println(s);
}
else
{
System.out.println("F");
}
}
}
else
{
System.out.println("1");
}
}
}
System.out.println(c);
}
}
}