Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

C while loop

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