While Loop C


Learn C - C tutorial - While loop c - C examples - C programs

While Loop C - Definition and Usage

  • In C- Programming the while statement is considered as a looping statement.
  • In C , the while Loop is executed, only when condition is true.
C While Loop Statement

C Syntax

while (condition is true)
C While Loop Statement

Sample - C Code

#include <stdio.h>
#include <conio.h>
void main()
    int i=1;
        printf("%d \n",i);

C Code - Explanation :

  1. Here in this statement we declare and initialize the value of “i=1”.
  2. In this statement we are defining the while statement and the condition for the execution of “i” value which is less than are equal to “5”, where it executes the statement.
  3. In this statement we print the value of “i”.
  4. Here in this statement the “i” value is incremented by one for each loop execution.

Sample Output - Programming Examples

  1. Here in this output the “i” value is incremented by one for each while loop execution which will be executed until the “i” value is less than are equal to “5”.

View More Quick Examples

Related Searches to C While Loop Statement

Adblocker detected! Please consider reading this notice.

We've detected that you are using AdBlock Plus or some other adblocking software which is preventing the page from fully loading.

We don't have any banner, Flash, animation, obnoxious sound, or popup ad. We do not implement these annoying types of ads!

We need money to operate the site, and almost all of it comes from our online advertising.

Please add wikitechy.com to your ad blocking whitelist or disable your adblocking software.