for loop for this pattern plz help me plz
Attachments:
Answers
Answered by
1
class Pattern
{
public static void main(String args[])
{
for(int i=1;i<=4;i++)
{
int a=5,b=3;
System.out.print(a+" "+b);
int c=0;
for(int j=1;j<=2;j++)
{
c=a-b;
a=b;
b=c;
System.out.print(" "+c);
}
System.out.println();
}
}
}
Attachments:
Similar questions