Saturday, August 29, 2020

Repeat 50 times: for ( int i=0 ; i < 50 ; i++ ) { }

for (int i=0; i<50; i++)
{
printf("hello, world\n");
}



....... the syntax of the "for loop" is a little more funky (than the while loop), but the for loop is more succinct while achieving the exact same thing


[Source: Harvard, CS50]



No comments:

Post a Comment