while Loop :

while loop :

A while loop is used to execute and repeat a block of statements depending on a condition.

Syntax :

  1. while ( <condition> )
  2. {
  3. <statement block>
  4. }

Example :

  1. /* Description: simple while loop 1 to 10 */
  2. #include<stdio.h>
  3. main()
  4. {
  5. int i=1;
  6. while(i<=10)
  7. {
  8. printf("%d ",i);
  9. i++;
  10. }
  11. getch();
  12. }

Output :

c language - simple while loop 1 to 10

Next Update

Loading...

We create a new YouTube channel (NightHawk) for gaming purpose like online games streaming or games review.

We need some time for make video tutorials (CodeX) so, stay with us and keep supporting and you know already we make a Collaboration with HackIsOn YouTube channel long time ago So, please Subscribe Our Channels

Protection died IPs active, this IP range is not allowed !