Skip to main content

While loop in C

 


#include<stdio.h>
int main()
{
    int i=1;
    while(i<=10)
    {
        printf("%d\n",i);
        i++;
    }
}














#include <stdio.h>
void main()

{
    int x = 4, y = 0, z;
    while (x >= 0)
    {
        if (x == y)
            break;
        else
            printf( "\n % d % d", x, y);
        x--;
        y++;
    }
}

Comments