How the Program is Flow in C /C++ | Logical Parts of a Program

By | July 28, 2015

Flow of a Program in C/C++. Learn How a Program is Flow in c /c++. And also learn about the logical Parts of a program that is necessary for a Program.

here we learn about the logical parts of a program that is necessary for a program and also brief introduction that how Program is flow in C /C++ and all its types that is use in flow of a program.

In this class i will tell you about the logical and necessary  parts of a Program ans also flow of a program and its Programming Techniques.

Asslam-o-alikum:

So lets Start our topic:)

First of all i will tell you about the Logical and necessary parts of the program. These are parts are necessary because if these are not exit then compiler gives syntax error and yet we cannot achieve our program requirements.

Now i have to write down the Logical parts of a program and then its brief explanation. There are three logical parts of a program these are as follows:

  1. Header file
  2. main Function
  3. body of the main Function

Header files:)

Header files are the collection of standard library functions that is used in different tasks in our program.There are many header files that are give by C/C++ languages about our requirements. Library files contain many built in functions that we use our program for different tasks.The syntax of the header file in our program is as follows…

#include<header file>                    //include is the keyword of the C/C++ language.

The example of some built in function are…

cout and cin for the header file iostream.h and getch() and clrscr() are the function of conio.h header file etc…

main Function:)

Main function is the necessary part of a program because there is the point where compiler start to read the program.

The syntax of the main function in C++ is as follows:

void main()                         //There is semicolon exist and it C++ is the case sensitive language .

Body of the main function:)

The Body of the main function is that place in which all the statements written of program. if some statements written outside the body then these statements cannot be executed.

NOW i will write the whole syntax withe all logical parts of a program…

#include<header file>

void main()

{                Body of the program that will be executed.
}

Programming Techniques:

The program is flow on the bases of the programming techniques that programer used in ones program.There are four programming techniques that are as follow…

Sequential Programming Techniques:

In this Technique all the statement are executed in the same order in which that is written in the program. It means no one statement can be skipped and no one statement can be executed more then one time.

sequence.[howpk.com

sequence.[howpk.com]

Conditional Programming Techniques:

In this Programming Technique block of statements can be executed and other is skipped. In the Technique the specific condition are use to judge that in which whose block of statement can be executed and whose block of statement can be skipped. There are three structures that is use in this technique are as follows…

if   structures ,     if else structures ,         nested if structures .

condition.[howpk.com]

condition.[howpk.com]

Iterative Programming Techniques:

The iterative Technique is use to execute a statement or set of statements more then once time. It is also called looping structure. There are also three iterative structure are as follows…

while loop ,     do while loop,  for loop/counter-control loop.

center[howpk.com]

center[howpk.com]

Function Call:

This technique is same as built in function. It means that the programmer write some code outside the body of the program and when he need this type of code he is not write the whole code. He only call its old code that is written by him in past. In this type of technique the control is move to another block in the run time.

call[howpk.com]

call[howpk.com]

i think it is enough for today  i hope today class is helpful to you and you have learn now how a Program is flow in c or C++.keep watching our site for more update and not forgot to register on our site for subscription.

any question then make a comment on us.  Thanks…

Author: Awais Shafique

Hello My name is Awias.I am Student of BSCS in GCUF. I am the Senior Contributor of this website.