Saturday, September 5, 2020

Break statement in c-programming

Break statement:


• The break statement is used to pass the control out of the loop, by breaking the loop.

• It is used only with loops and "switch...case" statements.

• It always transfers the control to  the next statement that follows it.

• Break is usually used with condition.

• The break statement is always associated with loops and switch case statements.

• "break" is a keyword.

• Example

    While(condition)

{    if(i<=10)

      {break;}

      printf("%d",i);

    i=i+1;

}


No comments:

Post a Comment

Object Paradigm Oriented Programming in C++ / object oriented programming / History of C++/ paradiagram in c++/C devolop, Operating System, Unix operating system, Assembly language, popular in world, Programming language.

  Object Paradigm Oriented Programming  Two programmers, Brian Kernighan and Dennis Ritchie developed a new language called C, in 1972.  C l...