do-while Loop :

do-while loop :

A do-while loop is also used to execute and repeat a block of statements depending on a condition.

Syntax :

  1. do
  2. {
  3. <statement block>
  4. }
  5. while ( <condition> )

Example :

  1. /* Description: simple do while loop 1 to 15 */
  2. #include<stdio.h>
  3. main()
  4. {
  5. int i=1;
  6. do
  7. {
  8. printf("%d ",i);
  9. i++;
  10. } while(i<=15);
  11. getch();
  12. }

Output :

c language - simple do while loop 1 to 15

Next Update

Loading...

Friend's some reason we need some long time for next update, Sorry For Long Time, see you soon.

We make a Collaboration with HackIsOn YouTube Channel So, Please Subscribe Their Channel and keep supporting