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

Shell script to print pyramid, Normal 0 false false false ...

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

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.

Visual Basic 6.0, i want to record in database but how to delete only dupli...

i want to record in database but how to delete only duplicate field not row in vb 6.0 or ms-access

Programming (problem solving), develop a pseudocode algorithm to determine ...

develop a pseudocode algorithm to determine the total amount of extra cost changed to the organizers for expenses accurednduring the workshop. the code is to be written for an unde

Visual logic, how much it will cost? i need learn how to make rightsided tr...

how much it will cost? i need learn how to make rightsided triangle in forloop

Version control systems - delete and update, The next major set of tasks to...

The next major set of tasks to tackle are delete and update. Version control systems typically version updates to a ?le and only store the differences between the ?les. Two system

Program to finds central individuals in arbitrary networks, Identifying the...

Identifying the Central Individual in a Social Network 1. Introduction You have just been hired by a social networking company! The division you are working in is particul

Write a function that will read the atoms for a protein, Write a function r...

Write a function readPDBfile('filename') that will read the atoms for a protein stored in a PDB file, whose name is provided as an input to the function (note that this name should

Fibonacci in windows assmbly language, Write an assembly program that compu...

Write an assembly program that computes Fibonacci numbers 2-5. a. Assume Fib(0)=0 and Fib(1)=1. b. Store Fib(2) in EAX, Fib(3) in EBX, Fib(4) in ECX and Fib(5) in EDX. c. Use a LOO

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