Programming-Idioms

History of Idiom 2 > diff from v103 to v104

Edit summary for version 104 :
[C] k

Version 103

2019-11-05, 05:30:26

Version 104

2019-11-23, 21:06:13

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
#include <stdio.h>
int main()
{
	int i;
	for(i=1;i<=100;i++)
	{
	printf("Hello marwa");
	}
}
Code
#include <stdio.h>
int main()
{
  int i;
  for (i = 0; i < 10; i++)
  {
    printf(" Hello Holberton\n");
  }
  return 0;
}

}
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