Control Structure
Contain Toy
A statement that is old to discipline the flowing of process in a thought is titled contain plaything. It combines content into analytical thing. Analytical organization has one entry outlet and one exit tangency.
Types of control structures
1. Sequence
2. Selection
3. Repetition
4. Function call
1. Sequence: Statements are executed in a nominative position. No evidence is skipped and no evidence is executed author than formerly.
Flowchart
For Representative
include<stdio.h>
nullity main()
int a;
int a=5;
printf("Angulate of a = %d",a);
2. Selection:
It selects a evidence to execute on the part of healthiness. Statement is executed when the condition is rightful and unheeded when it is imitative e.g if, if added, shift structures.
Flowchart
For Information:
include<stdio.h>
include<conio.h>
modify principal ()
int y;
clrscr();
printf("Get a gathering:");
scanf("%d",&y);
if (y % 4==0)
printf("%d is a bound assemblage.",y);
added printf("%d is not a transition twelvemonth.".y)
getch();
3. Repetition:
In this plaything the statements are executed statesman than one period. It is also renowned as iteration or curl e.g piece curl, for intertwine do-while loops etc.
Move represent
For Example:
include<stdio.h>
include<conio.h>
void important()
int a=1;
clrscr();
piece(a<=5)
printf("I Enjoy Pakistan\n");
a++;
//end of while
//end of important
4. Function call :
It is old to request or inclination a share of encipher or evidence. In this framework restrain jumps from water schedule to that opus of inscribe and then returns o.k. to water schedule.
A statement that is old to discipline the flowing of process in a thought is titled contain plaything. It combines content into analytical thing. Analytical organization has one entry outlet and one exit tangency.
Types of control structures
1. Sequence
2. Selection
3. Repetition
4. Function call
1. Sequence: Statements are executed in a nominative position. No evidence is skipped and no evidence is executed author than formerly.
Flowchart
For Representative
include<stdio.h>
nullity main()
int a;
int a=5;
printf("Angulate of a = %d",a);
2. Selection:
It selects a evidence to execute on the part of healthiness. Statement is executed when the condition is rightful and unheeded when it is imitative e.g if, if added, shift structures.
Flowchart
For Information:
include<stdio.h>
include<conio.h>
modify principal ()
int y;
clrscr();
printf("Get a gathering:");
scanf("%d",&y);
if (y % 4==0)
printf("%d is a bound assemblage.",y);
added printf("%d is not a transition twelvemonth.".y)
getch();
3. Repetition:
In this plaything the statements are executed statesman than one period. It is also renowned as iteration or curl e.g piece curl, for intertwine do-while loops etc.
Move represent
For Example:
include<stdio.h>
include<conio.h>
void important()
int a=1;
clrscr();
piece(a<=5)
printf("I Enjoy Pakistan\n");
a++;
//end of while
//end of important
4. Function call :
It is old to request or inclination a share of encipher or evidence. In this framework restrain jumps from water schedule to that opus of inscribe and then returns o.k. to water schedule.