Computer Science, asked by diya333, 1 year ago

using for loop
plz help java

Attachments:

Answers

Answered by Anonymous
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:

Anonymous: check it
Anonymous: 100% right
diya333: Thank you kunal
diya333: Brave
Anonymous: welcome
Similar questions