Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

What is Sequence Structure in C++

In a Sequence Structure or sequential structure, the statements of a Program are executed in the same order in which they are written in the program. The statements are executed one after the other. In this structure, all statements of the program executed sequentially without skipping any Statement
An algorithm with sequence structure are as follows:

In the above diagram, the first statement is "Statement-1" and "Statement-n" is the last statement that will be executed in a sequence from top to bottom (such as from statement-1 to statement-n).

Example Program of C++ Sequence Structure:

The following source code of the program execute statement one by other and displays result on the screen. 


#include


#include


main()


{


  cout

  cout

  cout

  cout

  getch();


}//end main function

If you run this program, the output will be as follows:
First statement
Second statement
Third statement
Forth statement



This post first appeared on Programming Explain, please read the originial post: here

Share the post

What is Sequence Structure in C++

×

Subscribe to Programming Explain

Get updates delivered right to your inbox!

Thank you for your subscription

×