java programs for the above questions using do while loop
somebody pls help me
Attachments:
Answers
Answered by
1
Answer: I can help you with this.
1.
String operation='"minus";
Int N=100;
Int total=0;
For(int I =1; I<=N;I++)
{
switch(operation)
{
Case minus:
Total=total - I;
Operation="plus";
Break;
Case plus:
Total=total+ I;
Operation="minus";
Break;
}
System.println(total);
}
Similar questions