Use any legal expression for the third expression - C Statement

C examples for Statement:for

Introduction

Whatever you put in the third expression will be updated for each iteration.

Demo Code

#include <stdio.h>

int main(void)
{
    int x;//from   www. j  a va 2  s  .co m
    int y = 55;
    
    for (x = 1; y <= 75; y = (++x * 5) + 50)
        printf("%10d %10d\n", x, y);
    return 0;
}

Result


Related Tutorials