C - Write program to break out of a endless for loop

Requirements

Write program to break out of a endless for loop

Demo

#include <stdio.h>

int main()//from  w w  w.j a v a  2  s.c o  m
{
    int count;

    count = 0;
    for(;;)
    {
        printf("%d, ",count);
        count = count+1;
        if( count > 50)
            break;
    }
    putchar('\n');
    return(0);
}

Result

Related Exercise