The Break Keyword (Program)

break


Program:

#include<stdio.h>

#include<conio.h>


void main()

{

    int i=1;

    clrscr();

    while(1)

    {

        if(i>10)

        {

            break;

        }

        else

        {

            printf("%d\n",i);

            i++;

        }

    }

    getch();

}


Output:

1

2

3

4

5

6

7

8

9

10

Comments

Post a Comment

Popular posts from this blog

C program to read and display book information using structure

Count positive, negative and zero values in an array

Maximum value from array