Computer Science, asked by gurmeet181277, 2 months ago

write this using for loop ​

Attachments:

Answers

Answered by jeromeseejo73
0

Answer:

int a,b=2,n;

//please specify the value of 'n'

//otherwise it will go wrong

for(a=1;a<=n; a=a+2)

{

  b+=a;

  ++b;

}

System.out.println("b="+b)

Explanation:

Similar questions