answersLogoWhite

0


Best Answer

multiple alternative decision structure / case structure

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What structure allows you to test the value of a variable or an expression and then use that to determine which statement or set of statements to execute?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Structure of If-Then statement?

if (condition) statement1 [else statement2] example: if (i==j); else if (j==k) printf ("i!=j, j==k\n); else printf ("i!=j, j!=k\n); here statement1 is an empty-statement, statement2 is another if-statement There are three forms of statements IF-THEN IF-THEN-ELSE IF-THEN-ELSIF Sequence of statements is executed only if the condition evaluates to TRUE If condition evaluates to FALSE or NULL, it does nothing In either case control passes to next statement after the IF-THEN structure IF THEN statements; END IF; Sequence of statements in the ELSE clause is executed only if the condition evaluates to FALSE or NULL IF THEN statements; ELSE statements; END IF;


What is the repetitive control structure in c plus plus?

C provides two sytles of flow control:BranchingLoopingBranching 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 ExampleWhat 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.


What structure causes a statement or set of statements to execute repeatedly?

A Loop.


What statement is used to skip the remainder of the body of a repetition structure and proceed with the next iteration of the loop?

The continue statement skips the remaining statements in the current iteration and execution proceeds with the iteration control statement for the next iteration.


What is the if-else statement in c plus plus programming language?

The if-then-else inline command is shown below: returnvalue = (condition) ? (truePart) : (falsePart); ----------- According to the C standard, this command does exist in the C coding language in the same way as it exists in C++ and comparable languages. http://users.ece.cmu.edu/~eno/coding/CCodingStandard.html

Related questions

How to write an if then statement?

It depends on the language however most use the following syntax: if (expression) then statement else statement endif Note that the "then" and "endif" keywords are not used in all languages since they are implied by the statement's structure and are normally only found in verbose languages such as BASIC. In C and C++, for instance, we have the following form: if (expression) { statement; } else { statement; } The expression must be a boolean expression; one that evaluates true or false. If the expression evaluates to a number, the expression evaluates true when the number is non-zero, otherwise it is false. When the expression is true, the first statement is executed otherwise the second statement is executed. Often we do not wish to execute anything when an expression is false, only when it is true, so the else clause is optional. if (expression) statement; In languages that use braces {} to denote structure, they are usually optional for simple statements but mandatory for compound statements. A compound statement is a group of statements that are treated as being one statement. Either statement may itself be an if statement (a nested if): if (expression) { if (expression) { statement; } else { statement; } } else { statement; } Spreading if statements over multiple lines and using whitespace indentation helps to highlight the logic and structure of the statement. It is not possible to show whitespace indentation here, but here's the same example using periods instead of whitespace: if (expression) { ...if (expression) { ......statement; ...} else { ......statement; ...} } else { ...statement; } Note the use of blank lines to separate the inner (nested) if from the outer if.


Structure of If-Then statement?

if (condition) statement1 [else statement2] example: if (i==j); else if (j==k) printf ("i!=j, j==k\n); else printf ("i!=j, j!=k\n); here statement1 is an empty-statement, statement2 is another if-statement There are three forms of statements IF-THEN IF-THEN-ELSE IF-THEN-ELSIF Sequence of statements is executed only if the condition evaluates to TRUE If condition evaluates to FALSE or NULL, it does nothing In either case control passes to next statement after the IF-THEN structure IF THEN statements; END IF; Sequence of statements in the ELSE clause is executed only if the condition evaluates to FALSE or NULL IF THEN statements; ELSE statements; END IF;


What is the repetitive control structure in c plus plus?

C provides two sytles of flow control:BranchingLoopingBranching 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 ExampleWhat 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.


What statement best describes the structure of a lipid molecule?

There are many statements which best describes the structure of a lipid molecule. The structure of a lipid molecule is a triglyceride. It consists of palmitoyl, oleoyl and stearoyl.


What structure causes a statement or set of statements to execute repeatedly?

A Loop.


What statement is used to skip the remainder of the body of a repetition structure and proceed with the next iteration of the loop?

The continue statement skips the remaining statements in the current iteration and execution proceeds with the iteration control statement for the next iteration.


What are the current changes in international accounting standard 1?

Changes to the structure of financial statements; inclusion of statement of changes in equity; The pattern of disclosure and classification.


Which of these statements is falseMusic is placing sounds into an unorganized structure.Music can be used to convey a message or idea.Music is one of the oldest forms of artistic expression.?

Music is placing sounds into an unorganized structure.


What is the if-else statement in c plus plus programming language?

The if-then-else inline command is shown below: returnvalue = (condition) ? (truePart) : (falsePart); ----------- According to the C standard, this command does exist in the C coding language in the same way as it exists in C++ and comparable languages. http://users.ece.cmu.edu/~eno/coding/CCodingStandard.html


What optional statement can be used in a case structure to execute statements when all other conditions are false?

default : <statement>; i.e. switch (value) { case 1 : do_this(); break; case 2 : do_that(); break; default : do_whatever(); }


What does mean selection in c program?

selection Also called a decision, one of the three basic logic structures in computerprogramming. The other two logic structures are sequence and loop.In a selection structure, a question is asked, and depending on the answer, the program takes one of two courses of action, after which the program moves on to the next event.This structure is sometimes referred to as an if-then-else because it directs the program to perform in this way: If Condition A is True then perform Action X else perform Action Y.All logic problems in programming can be solved by forming algorithms using only the three logic structures, and they can be combined in an infinite number of ways. The more complex the computing need, the more complex the combination of structures.


What structure can be execute a set of statements only under certain circumstances?

Decision structure.