answersLogoWhite

0

A control statement is any statement that alters the normal flow of execution. C++ code normally executes procedurally from the top down, however when invoking functions, execution branches off to the function code before returning to the instruction immediately after the function call. A compound statement may consist of several function calls, however even a simple statement may incur more than one function call, where the result of one function provides the argument for another.

Decision-making statements like if, if-else and switch can also be used to control the flow of execution, as can the ternary operator (?:). Loops such as for, while and do-while are also examples of control statements.

Other examples include goto, break, continue, return, abort and exit, often used in conjunction with decision-making statement.

Functions that return void also allow execution to "fall off the end" of the function, which is essentially an implicit return statement. The global main function is the only non-void function that can "fall off the end" (implicitly returning the integral value 0).

User Avatar

Wiki User

10y ago

What else can I help you with?

Related Questions

What is difference between control statements and looping statements in c language?

differance between control statement and looping statement?


What statement can be used to transfer control back to the main program after the execution of a subroutine?

It depends what language you are using. Structured languages provide the easiest method, simply call the function containing your subroutine and control will automatically return to the point of the call when the function ends. You can even use functions to return a value to the caller. If functions are not an option, the language might provide a gosub statement. This is similar to a goto statement but returns control to the caller, much like a function would in a structured language.


Explain goto and return in c?

A return statement is used to transfer the program control flow to the function that has called the current function under execution. If the function is main, then the program returns the control flow to the operating system. The syntax for return statement is:return return-type;A goto statement is used to transfer the control flow to a particular labelled statement, not necessarily back to the calling program. There are somerestrictionson using a goto statement. For eg: the goto statement should not skip any variable declarations. The use of goto statement is usually considered as a bad programming practice. The syntax for goto statement is:goto label_name;....label_name: statements;


What is a control statement?

The controlling statement controls the writing you will do


What are examples from history or today that support this statement Those who control the power to govern are resistant to any kind of change because they fear such changes will decrease their power?

what is the answer


How do you use a C-continue statement in a block- without any looping or conditional statements?

In the C language, the continue statement can only be used within a loop (for, while, or do). Upon execution, control transfers to the beginning of the loop.


How does magnetic contactor operate?

explain me about the contactor works with examples. if i want to control a motor with contactor. and how i can use contactor in loops with over load and circuit breakers.


How do you use continue statement in c language?

In C continue stements are used inside the loops like for .while,do while .its a statement used in c language wher it tell the compiler to skip the following statement(statement or part of progm following continue)&continue with next iteration.it shud me noted that its diff from break statement wher the control of prog goes out of the particular loop.in case of for ,while ,or do loops when we use continue the rest of the loop will not me excecuted and it will go back to check the condition of the loop.


What statement about control group is false?

the control group is recieving the medication


What is goto?

A statement found in many computer programming languages. It is a combination of the English words go and to. When executed it causes an unconditional transfer of control (a "jump") to another statement. The jumped-to statement is specified using some kind of label, which may be an identifier or a line number depending on the language. At the machine code level a goto is a form of branch or jump statement.


What is Control panel explain?

control panel is amaage fui.


Explain Soil stabilisers test and field control?

Explain Soil