while loop C

#include <stdio.h>

int main() {
    int i = 1;

    while (i <= 5) {
        printf("Iteration %d\n", i);
        i++;
    }

    return 0;
}
  1. Include the standard input-output library (stdio.h).

  2. Define the main function.

  3. Declare an integer variable i and initialize it to 1.

  4. Start a while loop with the condition i <= 5.

  5. Inside the loop, print the current value of i using printf.

  6. Increment the value of i by 1 using the i++ shorthand.

  7. Continue looping until the condition i <= 5 is false.

  8. End the main function and return 0.