Bifalgorithm post · Computer science one · Other Issues

How does a do-while loop work in C?

How does a do-while loop work in C? (Computer science one · Other Issues) — "int i;\n\ndo {\n\n//perform some action\n\ni++;\n\n} while(i<=10);\n\nCode Sample…

Ideas in this flowchart

  • Do-While Loop in C
  • int i; declares the integer variable i.
  • The do block performs the specified action.
  • i++ increments i after the action.
  • while(i<=10) tests the continuation condition.
  • If i<=10 is true, the loop repeats.
  • If i<=10 is false, the loop ends.
  • The continuation condition appears at the end, although it is not an executable statement.
  • The code is identified as Code Sample 17.4.
Feed/

How does a do-while loop work in C?

No cover

Channel

Computer science one

1 page

"int i;\n\ndo {\n\n//perform some action\n\ni++;\n\n} while(i<=10);\n\nCode Sample 17.4.: Do-While Loop in C appear at the end of the continuation condition even though it is not an executable statement."

Flowchart preview
👍
0
0 comments0 shares

Sign in to view and post comments.