Structured Programming
| Site: | Michael E-learning Platform |
| Course: | Michael E-learning Platform |
| Book: | Structured Programming |
| Printed by: | |
| Date: | Saturday, 15 November 2025, 4:50 AM |
Description
Structured programming is a programming approach that emphasizes writing clear, organized, and logical code by dividing a program into smaller, manageable sections or functions. It uses three main control structures—sequence, selection, and iteration—to control the flow of the program instead of using unstructured jumps like goto statements. This method promotes top-down design, making programs easier to read, debug, test, and maintain. It is commonly used in languages such as C, Pascal, and Python, and forms the foundation of modern programming practices.
1. INTRODUCTION TO STRUCTURED PROGRAMMING
Basic Programming Concept
Program and Programming
A computer program is a series of organized instructions that directs a computer to perform
tasks. Without programs, computers are useless.
A program is like a recipe. It contains a list of variables (called ingredients) and a list of
statements (called directions) that tell the computer what to do with the variables.
Programming is a creation of a set of commands or instructions which directs a computer in
carrying out a task.
A programming language is a set of words, symbols and codes that enables humans to
communicate with computers.
Examples of programming languages are:
BASIC (Beginner‘s All Purpose Symbolic Instruction Code)
Pascal
C
Smalltalk.
Structured programming and other programming languages
Structured programming (sometimes known as modular programming) is a subset of
procedural programming that enforces a logical structure on the program being written to
make it more efficient and easier to understand and modify. Certain languages such as Ada,
Pascal, and dBASE are designed with features that encourage or enforce a logical program
structure.
Structured programming frequently employs a top-down design model, in which developers map out
the overall program structure into separate subsections.Program flow follows a simple hierarchical
model that employs looping constructs such as "for," "repeat," and "while." Use of the "Go To"
statement is discouraged.
C is called a structured programming language because to solve a large problem, C
programming language divides the problem into smaller modules called functions or
procedures each of which handles a particular responsibility. The program which solves the
entire problem is a collection of such functions. One major drawback of C language is that
similar functions cannot be grouped inside a module or class. Also functions cannot be
associated to a type or structure. Thus data and functions cannot be bound together. C++
Page 4 of 172
language overcomes these problems by introducing object oriented functionality in its
programming capabilities.
1.1. Development of Programming Language
FIRST GENERATION OF PROGRAMMING LANGUAGE
The first generation of programming language, or 1GL, is machine language. Machine language
is a set of instructions and data that a computer's central processing unit can execute directly.
Machine language statements are written in binary code, and each statement corresponds to one
machine action.
SECOND GENERATION PROGRAMMING LANGUAGE
The second generation programming language, or 2GL, is assembly language. Assembly
language is the human-readable notation for the machine language used to control specific
computer operations. An assembly language programmer writes instructions using symbolic
instruction codes that are meaningful abbreviations or mnemonics. An assembler is a program
that translates assembly language into machine language.
THIRD GENERATION PROGRAMMING LANGUAGE
The third generation of programming language, 3GL, or procedural language uses a series of
English-like words, that are closer to human language, to write instructions.
High-level programming languages make complex programming simpler and easier to read,
write and maintain. Programs written in a high-level programming language must be translated
into machine language by a compiler or interpreter.
PASCAL, FORTRAN, BASIC, COBOL, C and C++ are examples of third generation
programming languages.
FOURTH GENERATION PROGRAMMING LANGUAGE
The fourth generation programming language or non-procedural language, often abbreviated as
4GL, enables users to access data in a database.
A very high-level programming language is often referred to as goal-oriented programming
language because it is usually limited to a very specific application and it might use syntax that is
never used in other programming languages.
SQL, NOMAD and FOCUS are examples of fourth generation programming languages.
FIFTH GENERATION PROGRAMMING LANGUAGE
The fifth generation programming language or visual programming language is also known as
natural language. Provides a visual or graphical interface, called a visual programming
environment, for creating source codes. Fifth generation programming allows people to interact
with computers without needing any specialized knowledge. People can talk to computers and
the voice recognition systems can convert spoken sounds into written words.
Prolog and Mercury are the best known fifth-generation languages.
EXT : OPEN PROGRAMMING LANGUAGE
The Open Programming Language (OPL) is an embedded programming language found in
portable devices that run the Symbian Operating System. For example mobile telephones and
PDAs. OPL is an interpreted language that is analogous to BASIC.
Page 5 of 172
1.2. Programming Paradigms
A programming paradigm is a style or ―way‖ of programming. Some languages make it easy
to write in some paradigms but not others. Never use the phrase ―programming language
paradigm.‖ A paradigm is a way of doing something (like programming), and not a concrete
thing (like a language).
Some of the more common paradigms are
Imperative — Control flow is an explicit sequence of commands.
Declarative — Programs state the result you want, not how to get it.
Structured — Programs have clean, goto-free, nested control structures.
Procedural — Imperative programming with procedure calls.
Functional (Applicative) — Computation proceeds by (nested) function calls that avoid
any global state.
Function-Level (Combinator) — Programs have no variables. No kidding.
Object-Oriented — Computation is effected by sending messages to objects; objects
have state and behavior.
o Class-based — Objects get their state and behavior based on membership in a
class.
o Prototype-based — Objects get their behavior from a prototype object.
Event-Driven — Control flow is determined by asynchronous actions (from humans or
sensors).
Flow-Driven — Computation is specified by multiple processes communicating over
predefined channels.
Logic (Rule-based) — Programmer specifies a set of facts and rules, and an engine
infers the answers to questions.
Constraint — Programmer specifies a set of constraints, and an engine infers the
answers to questions.
Aspect-Oriented — Programs have cross-cutting concerns applied transparently.
Reflective — Programs manipulate their own structures.
Array — Operators are extended to arrays, so loops are normally unnecessary.
Paradigms are not meant to be mutually exclusive; you can program in a functional, object
oriented, event-driven style.
2. PROGRAM DEVELOPMENT AND DESIGN
CHAPTER 2: PROGRAM DEVELOPMENT AND
DESIGN
Introduction to program development
Program development in computing; refer to the coding of an individual software program or
to the creation on an entire information system and all related software.
Program design is the activity of progressing from a specification of some required program to a
description of the program itself.
It is the process that organizations use to develop a program. Ideally, the process is
collaborative, iterative, and tentative—stakeholders work together to repeat, review, and refine a
program until they believe it will consistently achieve its purpose.
A program design is also the plan of action that results from that process. Ideally, the plan is
developed to the point that others can implement the program in the same way and consistently
achieve its purpose.
2.1. Program Development Cycle
Program Development Cycle

1. Analyze – Define the problem.
You must have a clear idea of what data (or input) is given and the relationship between the
input and the desired output.
2. Design – Plan the solution to the problem.
Find a logical sequence of precises steps that solve the problem (aka the algorithm). The logical
plan may include flowcharts, psuedocode, and top-down charts.
Page 10 of 172
3. Design the interface – Select objects (text boxes, buttons, etc.).
Determine how to obtain input and how the output will be displayed. Objects are created to
receive input and display output. Appropriate menus, buttons, etc. are created to allow user to
control the program.
4. Code – Translate algorithm into a programming language.
During this stage that program is written.
5. Test and debug – Locate and remove errors in program.
Testing is the process for finding errors. Debugging is the process for correcting errors.
6. Complete the documentation – Organize all materials that describe the program.
Documentation is necessary to allow another programmer or non-programmer to understand
the program. Internal documentation, known as comments, is created to assist a programmer.
An instruction manual is created for the non-programmer. Documentation should be done
during the coding stage.
2.2. Programming Techniques
Programming Techniques
Software designing is very anesthetic phase of software development cycle. The beauty of heart, skill of mind and practical thinking is mixed with system objective to implement design.
The designing process is not simple, but complex, cumbersome and frustrating with many curves in the way of successful design.
Here are some approaches:
· Structural Programming
· Modular Designing
· Top Down Designing
· Bottom Up Designing
· Object Oriented Programming
The objective of Program design are:
(i) Replace old system: The new system is used to replace old system because maintenance cost is high in old system and efficiency level low.
(ii) Demand of Organization: The new system is developed and installed on the demand of organization and working groups.
(iii) Productivity: The new system is installed to increase productivity of company or organization.
(iv) Competition: The new system is a matter of status also. In the age of roaring competition, if organization does not cope with modem technology failed to face competitions.
(v) Maintenance: The new system is needed to maintain organization status.
1. Structured Programming
This is the first programming approach used widely in beginning. Professor Edsger Wybe Dijkstra (1960) coins the term Structural Programming. Italian computer scientist C. Bohm and
G. Jacopini (1966) give the basic principal that supports this approach. The structured programming movement started in 1970, and much has been written about it. It is often regarded as ―goto-less‖ programming, because it is avoided by programmers.
The program is divided into several basic structures. These structures are called building blocks. These are following:
(a) Sequence Structure: This module contains program statements one after another. This is a very simple module of Structured Programming.
![]() |
Sequence Structure
(b) Selection or Conditional Structure: The Program has many conditions from which correct condition is selected to solve problems. These are (a) if-else (b) else-if, and (c) switch-case

Conditional structure
(c) Repetition or loop Structure: The process of repetition or iteration repeats statements blocks several times when condition is matched, if condition is not matched, looping process is terminated. In C, (a) goto, (b) for (), (c) do, (d) do – while are used for this purpose.
![]() |
Loop Structure
Advantage:
· Problem can be easily described using Flowchart and flowchart can be easily coded into program because the nature of this technique is like as flowchart.
· The program is easily coded using modules.
· The testing and debugging is easy because testing and debugging can be performed module-wise.
· Program development cost low.
· Higher productivity, high quality program production.
· Easy to modify and maintain
· It is called “gotoless” programming because use of goto for unconditional branching is strongly avoided. The goto is a sign of poor program design, so many designing concepts are not favoring it but it is used in all programming language widely. When more goto is used in program, program become less readable and its impact is negative in program functionality. So it is saying about goto:”Never, ever, ever use goto! It is evil”.
Disadvantage:
More memory space is required. When the numbers of modules are out of certain range, performance of program is not satisfactory.
2. Modular Programming
When we study educational philosophy, the concept of modulation can be clear without any ambiguity. Rene Descartes (1596-1650) of France has given concept to reconstruct our knowledge by piece by piece. The piece is nothing, but it is a module of modem programming context.
In modular approach, large program is divided into many small discrete components called Modules. In programming language, different names are used for it.
For example:
|
Q-basic, Fortran |
Subroutine |
|
Pascal |
Procedure or Function |
|
C, C+, C#, Java |
Function |
It is logically separable part of program. Modules are independent and easily manageable. Generally modules of 20 to 50 lines considered as good modules when lines are increased, the controlling of module become complex.
Modules are debugged and tested separately and combined to build system. The top module is called root or boss modules which charges control over all sub-modules from top to bottom. The control flows from top to bottom, but not from bottom to top.
The evaluation of modeling is called coupling and cohesion. The module coupling denotes number of interconnections between modules and module cohesion shows relationship among data or elements within a module.

Modular Programming
3. Top down Approach
(a) The large program is divided into many small module or subprogram or function or procedure from top to bottom.
(b) At first supervisor program is identified to control other sub modules. Main modules are divided into sub modules, sub-modules into sub- sub- modules. The decomposition of modules is continuing whenever desired module level is not obtained.
(c) Top module is tested first, and then sub-modules are combined one by one and tested.
![]() |
Top down Approach
Example: The main program is divided into sub-program A, B, and C. The A is divided into subprogram A1, A2 and A3.The B is into B1, and B2. Just like these subprograms, C is also divided into three subprogram C1, C2 and C3. The solution of Main program is obtained from sub program A, B and C.
4. Bottom up Approach
· In this approach designing is started from bottom and advanced stepwise to top. So, this approach is called Bottom up approach.
· At first bottom layer modules are designed and tested, second layer modules are designed and combined with bottom layer and combined modules are tested. In this way, designing and testing progressed from bottom to top.
· In software designing, only pure top down or Bottom up approach is not used. The hybrid type of approach is recommended by many designers in which top down and bottom up, both approaches are utilized.
5. Object oriented programming
In the object-oriented programming, program is divided into a set of objects. The emphasis given on objects, not on procedures. All the programming activities revolve around objects. An object is a real world entity. It may be airplane, ship, car, house, horse, customer, bank Account, loan, petrol, fee, courses, and Registration number etc. Objects are tied with functions. Objects are not free for walk without leg of functions. One object talks with other through earphone of functions. Object is a boss but captive of functions.
Features of Object oriented Language
· The program is decomposed into several objects. In this language, emphasis is given to the objects and objects are central points of programming. All the activities are object centered.
· Objects occupy spaces in memory and have memory address like as records in PASCAL and structure in C language.
· Data and its functions are encapsulated into a single entity.
· Reusability: In C++, we create classes and these classes have power of reusability. Other programmers can use these classes.
· It supports bottom up approach of programming. In this approach designing is started from bottom and advanced stepwise to top.
Some technical terms supporting object-oriented languages are:
(i) Abstraction: The abstraction is an important property of OOP. The use of essential features over less essential features is called abstraction. The following examples will help to understand abstraction.
Example: The computer operators know only to operate computer, but they are unaware to internal organization of computer.
In OOP, there are many devices used for data abstraction such as class, encapsulation, data hiding etc.
(ii) Class: A class is a collection of similar objects. Objects are members of class. Once a class is declared, its many members can be easily created in programs. The class binds attributes (data and functions or methods) of member objects.
Examples:
Class employee
{
char name[30]; float basic; void getdata(); void show();
};
(iii) Polymorphism: The ability to find in many forms is called polymorphism (Poly: many, Morphe: shape / form). For instance, + is mathematical operator, it concatenates two strings and give sum of two digits (numbers). Here, operator + has different behavior for numerical data and strings. Just like it, once declared function has different meaning that is called function overloading. If operator has different meaning, it is called operator overloading.
(iv) Encapsulation: The encapsulation is a very striking feature of OOP in which data and function is bound into single unit. Array, records, structure are also example of low level encapsulation but term encapsulation is mostly used in object oriented language. The data and function are encapsulated into class. External world or external function cannot access the data. It can be accessed by its own function or method encapsulated with it into class. It hides private elements of objects behind public interface.
(v) Inheritance: Inheritance is a hierarchy of class in which some properties of base class is transferred to derived class. The main types of inheritance are:
(a) Single Inheritance: A derived class (child class or sub class) of single base (super or parent) class is called single Inheritance.
(b) Multiple Inheritances: A derived class of multiple base classes is called Multiple Inheritance.
(c) Multilevel Inheritance: When derived class is derived from another derived class, such type of inheritance is called Multilevel Inheritance.
Monolithic Design (architectural style or a software development Design pattern), describes a single-tiered software application in which the user interface and data access code are combined into a single program from a single platform.
A monolithic application is self-contained, and independent from other computing applications. The design philosophy is that the application is responsible not just for a particular task, but can perform every step needed to complete a particular function.
3. PROGRAM STRUCTURE
Introduction to program structure
Program structure The overall form of a program, with particular emphasis on the individual
components of the program and the interrelationships between these components. Programs are
frequently referred to as either well-structured or poorly structured.
Format of a structured programming language
A C program basically has the following form:
Preprocessor Commands
Functions
Variables
Statements & Expressions
Comments
The following program is written in the C programming language. Open a text file hello.c using
vi editor and put the following lines inside that file.
#include <stdio.h>
int main()
{
/* My first program */
printf("Hello, World! \n");
return 0;
}
Preprocessor Commands: These commands tells the compiler to do preprocessing before doing
actual compilation. Like #include <stdio.h> is a preprocessor command which tells a C compiler
to include stdio.h file before going to actual compilation. You will learn more about C
Preprocessors in C Preprocessors session.
Functions: are main building blocks of any C Program. Every C Program will have one or more
functions and there is one mandatory function which is called main() function. This function is
prefixed with keyword int which means this function returns an integer value when it exits. This
integer value is retured using return statement.
The C Programming language provides a set of built-in functions. In the above example printf()
is a C built-in function which is used to print anything on the screen.
Variables: are used to hold numbers, strings and complex data for manipulation.
Page 36 of 172
Statements & Expressions : Expressions combine variables and constants to create new values.
Statements are expressions, assignments, function calls, or control flow statements which make
up C programs.
Comments: are used to give additional useful information inside a C Program. All the comments
will be put inside /*...*/ as given in the example above. A comment can span through multiple
lines.
Note:
There should be a main function somewhere in the program to determine where to
start the executions.
Usually all C statements are entered in small case letters.
The group of statements in main are executed sequentially.
The left brace indicates the program opening.
The right brace indicates the program closing.
In C language Comments are enclosed with /* -- */ means these statements won‘t execute
when the program is complied.
A C program consists of one or more functions. Each function performs a specific task. A
function is a group or sequence of C statements that are executed together.
Every C program starts with a function called main(). This is the place where program
execution begins. Hence, there should be main() function in every C program. The functions are
building blocks of C program. Each function has a name and a list of parameters.
The following are some rules to write C programs
1. All C statements must end with semicolon.
2. C is case – sensitive. That is, upper case and lower case characters are different.
Generally the statements are typed in lower case.
3. A C statement can be written in one line or it can split into multiple lines.
4. Braces must always match upon pairs, i.e., every opening brace ‗{‗ must have a matching
closing brace ‗}‘.
5. A comment can be split into more than one line.
Page 37 of 172
3.1. Basic C Programs - Variable and I/O instructions
1) Print Hello Word
Let us look at a simple code that would print the words "Hello World":
#include <stdio.h>
int main()
{
/* my first program in C */
printf("Hello, World! \n");
return 0;
}
Let us look various parts of the above program:
1. The first line of the program #include <stdio.h> is a preprocessor command, which tells
a C compiler to include stdio.h file before going to actual compilation.
2. The next line int main() is the main function where program execution begins.
3. The next line /*...*/ will be ignored by the compiler and it has been put to add additional
comments in the program. So such lines are called comments in the program.
4. The next line printf(...) is another function available in C which causes the message
"Hello, World!" to be displayed on the screen.
5. The next line return 0; terminates main()function and returns the value 0.
Note: Compile & Execute C Program:
Let‘s look at how to save the source code in a file, and how to compile and run it. Following are
the simple steps:
1. Open a text editor and add the above-mentioned code.
2. Save the file as hello.c
3. Open a command prompt and go to the directory where you saved the file.
4. Type gcc hello.c and press enter to compile your code.
5. If there are no errors in your code the command prompt will take you to the next line and
would generate a.out executable file.
6. Now, type a.out to execute your program.
7. You will be able to see "Hello World" printed on the screen
2) Declaring Variable Inputing and Outputting Value
A variable is nothing but a name given to a storage area that our programs can manipulate.
Each variable in C has a specific type, which determines the size and layout of the variable's
memory; the range of values that can be stored within that memory; and the set of operations
that can be applied to the variable.
Page 38 of 172
a) Working with variables - Let's look at an example of how to declare an integer variable in
the C language, assign value and read the value in the variable to output.
For example:
int age;
In this example, the variable named age would be defined as an int.
Below is an example C program where we declare this variable:
#include <stdio.h>
int main()
{
int age;
age = 10;
printf("TechOnTheNet.com is over %d years old.\n", age);
return 0;
}
This C program would print "TechOnTheNet.com is over 10 years old."
Conversion specifiers are made up of two characters: % and a special character.
The special character tells the program how to convert the data.
Conversion Specifier Description
%d
%f
%c
Displays integer value
Displays floating-point numbers
Displays character
Format specifiers are the operators used in printf() function to print the data which is referred by an
object or a variable. when a value is stored in a particular variable, Then we cannot print the value
stored in the variable directly with out the using format specifiers. We can retrieve the data stored in
the variables and can print them on to the console screen by using these format specifiers in a printf
function. Format specifiers start with a percentage(%) symbol and follows a special character to identify
the type of the data. There are basically six types of format specifiers are available in c they are
%d - represent integer values
%f - represent float values
%c - represent single character values
%s - represent string values
%u - represent the address of a variable
%ld – represent Long integer values
Page 39 of 172
More examples: Use the printf function with formatting options.
#include <stdio.h>
main(){
int x;
float y;
char c;
x = -4443;
y = 554.21;
c = 'M';
printf("\nThe value of integer variable x is %d", x);
printf("\nThe value of float variable y is %f", y);
printf("\nThe value of character variable c is %c\n", c);
}
The value of integer variable x is -4443
The value of float variable y is 554.210022
The value of character variable c is M
More examples: Use the scanf function with formatting options assign to assign value to
variables.
This C program would print "Your Name is Kim and you age is over 10 yrs old."
#include <stdio.h>
main(){
int Age;
char Name[10];
printf("\nPlz enter your Name ");
scanf(“%s”,&Name);
printf("\nPlz enter your Age", y);
scanf(“%d”,&Age):
printf("\nYour Name is %s and your age is %d yrs old\n",Name,Age);
}
Page 40 of 172
3.2. Program Structures in Pascal
Before we study basic building blocks of the Pascal programming language, let us look a bare
minimum Pascal program structure so that we can take it as a reference in upcoming chapters.
Pascal Program Structure
A Pascal program basically consists of the following parts −
Program name
Uses command
Type declarations
Constant declarations
Variables declarations
Functions declarations
Procedures declarations
Main program block
Statements and Expressions within each block
Comments
Every pascal program generally has a heading statement, a declaration and an execution part
strictly in that order. Following format shows the basic syntax for a Pascal program −
program {name of the program}
uses {comma delimited names of libraries you use}
const {global constant declaration block}
var {global variable declaration block}
function {function declarations, if any}
{ local variables }
begin
...
end;
procedure { procedure declarations, if any}
{ local variables }
begin
...
end;
begin { main program block starts}
...
end. { the end of main program block }
Pascal Hello World Example
Following is a simple pascal code that would print the words "Hello, World!":
program HelloWorld;
uses crt;
(* Here the main program block starts *)
Page 42 of 172
begin
writeln('Hello, World!');
readkey;
end.
This will produce following result −
Hello, World!
Let us look various parts of the above program −
The first line of the program program HelloWorld; indicates the name of the program.
The second line of the program uses crt; is a preprocessor command, which tells the
compiler to include the crt unit before going to actual compilation.
The next lines enclosed within begin and end statements are the main program block.
Every block in Pascal is enclosed within a begin statement and an end statement.
However, the end statement indicating the end of the main program is followed by a full
stop (.) instead of semicolon (;).
The begin statement of the main program block is where the program execution begins.
The lines within (*...*) will be ignored by the compiler and it has been put to add a
comment in the program.
The statement writeln('Hello, World!'); uses the writeln function available in Pascal
which causes the message "Hello, World!" to be displayed on the screen.
The statement readkey; allows the display to pause until the user presses a key. It is part
of the crt unit. A unit is like a library in Pascal.
The last statement end. ends your program.
Pascal - Basic Syntax
You have seen a basic structure of pascal program, so it will be easy to understand other basic
building blocks of the pascal programming language.
Variables
A variable definition is put in a block beginning with a var keyword, followed by definitions of
the variables as follows:
var
A_Variable, B_Variable ... : Variable_Type;
i.e. A, b, c:interger
Pascal variables are declared outside the code-body of the function which means they are not
declared within the begin and end pairs, but they are declared after the definition of the
procedure/function and before the begin keyword. For global variables, they are defined after the
program header.
Functions/Procedures
In Pascal, a procedure is set of instructions to be executed, with no return value and a function
is a procedure with a return value. The definition of function/procedures will be as follows −
Function Func_Name(params...) : Return_Value;
Page 43 of 172
Procedure Proc_Name(params...);
Comments
The multiline comments are enclosed within curly brackets and asterisks as {* ... *}. Pascal
allows single-line comment enclosed within curly brackets { ... }.
{* This is a multi-line comments
and it will span multiple lines. *}
{ This is a single line comment in pascal }
Case Sensitivity
Pascal is a case non-sensitive language, which means you can write your variables, functions and
procedure in either case. Like variables A_Variable, a_variable and A_VARIABLE have same
meaning in Pascal.
Pascal Statements (I/O)
Pascal programs are made of statements. Each statement specifies a definite job of the program.
These jobs could be declaration, assignment, reading data, writing data, taking logical decisions,
transferring program flow control, etc.
For example −
readln (a, b, c);
s := (a + b + c)/2.0;
area := sqrt(s * (s - a)*(s-b)*(s-c));
writeln(area);
Note: All pascal functions and control structures start with name and follow with Begin..End in
place of carry bracket “, -” used in C programs.
1. Function Example
function name(argument(s): type1; argument(s): type2; ...): function_type;
local declarations;
begin
...
< statements >
...
name:= expression;
end;
program exFunction;
var
a, b, ret : integer;
2. Function and control structure Example
(*function definition *)
function max(num1, num2: integer): integer;
var
(* local variable declaration *)
result: integer;
begin
if (num1 > num2) then
begin
result := num1
writeln(result);
end;
else
begin
result := num2;
max := result;
writeln(max);
end;
end;
begin
a := 100;
b := 200;
(* calling a function to get max value *)
ret := max(a, b);
writeln( 'Max value is : ', ret );
end.


