User Tools

Site Tools


notes:cprog:fall2024:projects:cnv0

This is an old revision of the document!


CNV0

Background

Determining factor pairs

Compiling

Loops

for() loops

for() loops are used to repeat a block of code a certain amount of times

for() loops have a fixed format

for(first; second; third){code block}

The first expression is executed once at the start of the statement. The second expression must evaluate to a boolean and is evaluated before every loop. The third expression is executed after every loop.

The following is an example of how a for() loop can be used

for(int i = 10; i >= 0; i--){
fprintf(stdout, "T minus %d\n", i);
}
fprintf(stdout, "BLAST OFF!\n");

while() loops

do-while loops

notes/cprog/fall2024/projects/cnv0.1727581235.txt.gz · Last modified: 2024/09/29 03:40 by tkastne1