Computer Science, asked by sarthakkhandelwal599, 1 year ago

Differentiate between break and System. exit(0).
Answer within 5 minutes and ur answer will be marked THE BRAINLIEST ANSWER!

Answers

Answered by navin48
12

break is a keyword in C.

exit() is a standard library function.

break causes an immediate exit from the switch or loop (for, while or do).

exit() terminates program execution when it is called.

break is a reserved word in C; therefore it can't be used as a variable name.

exit() can be used as a variable name.

No header files needs to be included in order to use break statement in a C program.

stdlib.h needs to be included in order to use exit().

Answered by Anonymous
9

break is a keyword ,it terminates the loop when a condition passes through it

E.g.:

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

{

If(I<=5);

break;

}

Here when condition becomes true the loop terminates..

System.exit(0) is used to come out of a program.

Hope it helps..

Please mark brainliest

Similar questions