Computer Science, asked by aaryangoyal9459, 9 months ago

Write the syntax of ""break"" statement.

Answers

Answered by Abhis506
0

Answer is in the attachment

Attachments:
Answered by ridhimakh1219
0

Syntax of ""break"" statement.

Explanation:

Definition :The break refers to a keyword(predefined meaning) that terminates the loop immediately when encountered in a program and control switches to the statement immediately follows the body of the statement that contains break.

The basic syntax of a break statement in C or C++ is as below:

break;

Example:

#include <stdio.h>

void main()

{

   int i;

   for (i=1; i<=10; i++)

   {

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

       if (i == 5)

           break;

   }

   getch();

}

Output

1

2

3

4

5

Similar questions