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

Provide example of function, Provide Example of Function? An illustrati...

Provide Example of Function? An illustration of a function definition main() { message(); } /* header */ message() { /*bodystarts here*/ printf ("Example for function

ARM LANGUAGE, I WANT TO MAKE PROJECT IN ARM LANGUAGE CAN YOU HELP ME

I WANT TO MAKE PROJECT IN ARM LANGUAGE CAN YOU HELP ME

Design a mobile web browser..., HOW CAN I DESIGN A MOBILE WEB BROWSER LIKE ...

HOW CAN I DESIGN A MOBILE WEB BROWSER LIKE OPERA MINI. USING VISUAL BASIC? HELP ME.

Algorithm of sort the given array remove the repeated value, Short Arrays: ...

Short Arrays: Array = randi(10,1,randi(6,1,1)+4)-5 This command will generate an array which you should be able to evaluate by hand (and also have your code evaluate for te

STM32, Windows XP using C# load a binary file and send it thru a USB port t...

Windows XP using C# load a binary file and send it thru a USB port to the USB port of STM32. STM32 received the file and then write it into an I2C EEPROM.

Board coloring problem description, Board Coloring Problem Description ...

Board Coloring Problem Description In this problem you are given a board in which some of the elements are placed as shown in diagram below. Each element represents a color.

Shell script to compare that given two files are same or not, Normal 0 ...

Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4

Algorithem for create game application, Play is as follows: 1.) Player p...

Play is as follows: 1.) Player places a bet a. Bet is on one of three choice i. "Player" will win ii. "Banker" will win iii. Tie between the "Player" and the "Banker

Define a procedure that takes a list as a single argument, (a) Define a pro...

(a) Define a procedure (subsets x) that takes a list as a single argument and returns all 2^n subsets of that list, i.e. the power set of the list; e.g. (subsets '(a b c)) ==> (

Undetermined coefficients, We now require starting looking into finding a p...

We now require starting looking into finding a particular solution for n th order differential equations. The two ways which we'll be looking at are similar as those which we look

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