Write the syntax of ""break"" statement.
Answers
Answered by
0
Answer is in the attachment
Attachments:
Answered by
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
Math,
4 months ago
Math,
4 months ago
Computer Science,
9 months ago
Computer Science,
9 months ago
Math,
1 year ago
Physics,
1 year ago
Math,
1 year ago