Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

C do-while loop

//the syntax of the do-while loop statement is: init; do {statement(s);inc/dec;} while(condition);
//init=initialization
//inc=increment|incrementation formula is i++ or ++i
//dec=decrement|decrementation formula is i-- or --i
#include<stdio.h>
main()
{
	int n;
	    n=5;
	    do
	    {
		    printf("
%d ",n);
		    n--;
	    }
	    while(n>=1);
}
Source by beginnersbook.com #
 
PREVIOUS NEXT
Tagged: #C #loop
ADD COMMENT
Topic
Name
4+7 =