Explain the break statement - computer programming, Programming Languages

Assignment Help:

Explain the Break Statement - Computer Programming?

The break statement is used as an interrupt to the normal flow of control this statement causes as exit from the switch statement. It can be used within a while, for, do - while or switch statement and the break statement causes the control to come out of the entire loop. A break within a loop must always be protected within an if statement which provides the test to control the exit condition.

char ch;

ch=getchar();

switch(ch)

{

case 'a' :

case 'e' :

case 'i'  :

case 'o'            :

 case 'u'            :{

printf("Vowel");

break;

}

default :{

printf("Not a vowel");        

break;

 }

}

If the input take place to be 'a' or 'e', 'i', 'o', 'u' , the control goes to that particular case and prints "Vowel". By executing the break statement can't will come out of the loop.


Related Discussions:- Explain the break statement - computer programming

Data modelling-use case diagram and sequence diagram, On-line fair and ethi...

On-line fair and ethical share trading system (Olfest) A system is required that allows on-line customers to buy and sell stock market shares in a selection of companies. B

Applications of oop, Applications of OOP, The promising areas for applicati...

Applications of OOP, The promising areas for application of OOP include: Real-time systems Simulation and modelling Object-oriented databases Hypertext, hype

What is linear programming problem, QUESTION 1 (a) (i) What is linear p...

QUESTION 1 (a) (i) What is linear programming problem? (ii) Define and explain the following terms: (1) objective function, (2) decision variable, (3) constraints, (4) feasi

Visual basic 2010, I have to create a calorie counter and I am totally lost...

I have to create a calorie counter and I am totally lost

A Simple Distributed Computing Platform , You are asked to develop a replic...

You are asked to develop a replicator (client) that distributes a large job over a number of computers (a server group) on a single switched LAN (our BU04 lab). In this assignment,

Program for searching by indexing text files, Write a program that can faci...

Write a program that can facilitate searching by indexing text files according to words. In this task, you are given a large text file, sample.txt, which you will need to index the

Triple eigenvalue with 3 linearly independent eigenvectors, 1 Triple Eigenv...

1 Triple Eigenvalue with 3 Linearly Independent Eigenvectors In this case we will have the eigenvalue l with the three linearly independent eigenvectors  ?h 1 , ?h 2 and  ?h

Java exception handling, Expertsmind brings you unique solution in java as...

Expertsmind brings you unique solution in java assignments Exception Handling An exception is an issue that appears during the performance of an application. An exception

Series solutions - higher order differential equations, The idea of this se...

The idea of this section is not to do anything new along with a series solution problem.  Instead this is here to exemplify that moving in a higher order differential equation does

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd