answersLogoWhite

0


Best Answer

C provides two sytles of flow control:

  • Branching
  • Looping

Branching is deciding what actions to take and looping is deciding how many times to take a certain action. Branching: Branching is so called because the program chooses to follow one branch or another.

if statementThis is the most simple form of the branching statements.

It takes an expression in parenthesis and an statement or block of statements. if the expression is true then the statement or block of statements gets executed otherwise these statements are skipped.

? : OperatorThe ? : operator is just like an if ... else statement except that because it is an operator you can use it within expressions.

? : is a ternary operator in that it takes three values, this is the only ternary operator C has.

switch statement:The switch statement is much like a nested if .. else statement. Its mostly a matter of preference which you use, switch statement can be slightly more efficient and easier to read. Using break keyword:If a condition is met in switch case then execution continues on into the next case clause also if it is not explicitly specified that the execution should exit the switch statement. This is achieved by using break keyword.

Try out given example Show Example

What is default condition:If none of the listed conditions is met then default condition executed. Looping Loops provide a way to repeat commands and control how many times they are repeated. C provides a number of looping way. while loopThe most basic loop in C is the while loop.A while statement is like a repeating if statement. Like an If statement, if the test condition is true: the statements get executed. The difference is that after the statements have been executed, the test condition is checked again. If it is still true the statements get executed again.This cycle repeats until the test condition evaluates to false. for loopfor loop is similar to while, it's just written differently. for statements are often used to proccess lists such a range of numbers: do...while loopdo ... while is just like a while loop except that the test condition is checked at the end of the loop rather than the start. This has the effect that the content of the loop are always executed at least once. break and continue statements C provides two commands to control how we loop:
  • break -- exit form loop or switch.
  • continue -- skip 1 iteration of loop.
User Avatar

Wiki User

12y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

9y ago

Control structures are statements that alter the flow of execution. Without control structures, execution would simply flow from one statement to the next.

All control structures in C++ are introduced with one of the following keywords: if, switch, for, while and do. The conditional (ternary) operator (?:) can also be used as a control structure.

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

C language supports following control structures:

1)

if (condition)

{

//statements

}

else

{

//statements

}

2)

switch (condition)

{

case <expression>: //statements;

case <expression>: //statements; statements may include break at the end;

default: //statements

}

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

Conditional structures: if, else, else if

Iteration (or loop) structures: while, do, do while, for

Selective structures: switch

Jump/derail structures: break, continue, goto

This answer is:
User Avatar

User Avatar

Wiki User

9y ago

A control structure alters the flow of execution. The IF control structure evaluates a boolean expression and executes an associated statement only when the expression evaluates true. An IF-ELSE control structure provides an alternative statement that only executes when the expression evaluates false. A SWITCH-CASE is a control structure that evaluates a non-boolean expression and "jumps" to a labelled code section based on the value of the expression.

This answer is:
User Avatar

User Avatar

Wiki User

9y ago

Examples:

function-call, return, goto, do, for, while, if, else, switch, case, break

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

it defines the flow in which the execution of c language statements should take place to achieve the required result.

This answer is:
User Avatar

User Avatar

Wiki User

10y ago

Repetition is controlled by the use of structured while, do-while and for loops, as well as procedural goto loops.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the repetitive control structure in c plus plus?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Basic control structure available in c plus plus?

The basic control structure in C++ is the if statement.


What is the name of the structure type in C plus plus?

The same as in C, struct.


What is the Cdacl in c plus plus?

It's a wrapper for a discretionary access control list (DACL) structure. It is not part of the C++ standard, it's a Microsoft-specific class. Consult the MSDN for more information.


Do I need structure of turbo c plus plus?

Yes.


What is the price of the book data structure using c and c plus plus by tanenbaum?

225 Rs. after discount........


What is Counter Control in C plus plus?

Anybody can Help me PLEASE


What is objective of control structure and explain different control structre in c plus plus?

1.to clarify the program logic. 2. to serve as a guide for the program coding. 3. helps to identify alternative methods. BY. Brian Mwamuye Mwananje From Mombasa Kenya


Can you give an example of a structure in C plus plus?

struct point { int x; int y; };


What is the general structure of a C plus plus Language?

The central feature of any C++ program is classes which can be used to express ideas directly in code.


Control statement in c plus plus?

Control statements are statements that alter the flow of execution according to the evaluation of an expression (the condition). The C++ control statements are ifstatements, switch statements and the tertiary conditional operator, ?:.


What are the access control specifiers used in c plus plus?

The access control specifiers in C++ are...public - to denote that the member is accessible from any in scope codeprivate - to denote that the member is accessible only from within the containing classprotected - the same as private, except that derived classes are includedPrivate is the default for a class type object, while public is the default for a structure type object.


Basic structure of c n c plus plus?

The basic structure of a C or C++ program is built around types. A structure is a type. A function is a type. A class is a type. All of these types can be built from primitive (built-in) types and can be used to create ever-more complex types.