Logo

Programming-Idioms

History of Idiom 2 > diff from v101 to v102

Edit summary for version 102 by souad:
[C] my code

Version 101

2019-10-02, 14:04:14

Version 102

2019-10-31, 08:13:09

Idiom #2 Print Hello 10 times

Loop to execute some code a constant number of times

Illustration

Idiom #2 Print Hello 10 times

Loop to execute some code a constant number of times

Illustration
Code
for (int i = 0; i < 10; i++) {
    printf("Hello\n");
}
Code
#include <stdio.h>
int main()
{
	int i;
	for(i=1;i<=100;i++)
	{
	printf("Hello marwa");
	}
}
Comments bubble
Note the necessary newline (\n), not to print every time on the same line
Comments bubble
Note the necessary newline (\n), not to print every time on the same line