class Test
{
public static void main(String[]args)
{
int y=0;
int x=0;
for(int z=0;z<5;z++)
{
if((++x>2) && (++y>2))
{
x++;
}
}
System .out.println(x+""+y);
}
}Java program here i am using for loop and if condition and and operator
Java program here i am using for loop and if condition and and operator
class Test
{
public static void main(String[]args)
{
int y=0;
int x=0;
for(int z=0;z<5;z++)
{
if((++x>2) && (++y>2))
{
x++;
}
}
System .out.println(x+""+y);
}
}