User Tools

Site Tools


c:control_structures:for

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

c:control_structures:for [2013/01/17 23:47]
Daniel Gohlke
c:control_structures:for [2013/01/22 22:02] (current)
Line 1: Line 1:
 +{{keywords>wiki library source code example reference}}
 +===== for =====
  
 +<code c>
 +#include <stdio.h> /* including standard library */
 +//#include <windows.h> /* uncomment this for Windows */
 +
 +    for ( init; condition; increment ){
 +    statements;    
 +    } 
 +</code>    
 +===== C Sourcecode Example =====
 +
 +<code c>
 +#include <stdio.h> /* including standard library */
 +//#include <windows.h> /* uncomment this for Windows */
 +
 +int main( void )
 +{
 +  int i;
 +  for (i=0;i<=42;i++){
 +   
 +        printf("i is : %i\n",i);
 +}
 +
 +return 0;
 +}
 +
 +</code>
 +
 +    output of for loop
 +    i is : 0
 +    i is : 1
 +    i is : 2
 +    i is : 3
 +    and so on
advertising

Impressum Datenschutz