Home

A program to explain unconditional statement BREAK

C Programming Language 039

The following code shows how to write a program to explain unconditional statement BREAK inside a for loop.

Program

#include <stdio.h>

void main()
{
    int i;
    for (i = 0; i <= 10; i++)
    {
        printf("%d\n", i);
        if (i == 3)
        {
            break;
        }
    }

    printf("\n");
}

Result

0
1
2
3


Last Updated on

Next Post: Rules vs Guidelines →

Comments