0% found this document useful (0 votes)
21 views37 pages

Unit 1

Programming life cycle and SDLC

Uploaded by

Online User
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views37 pages

Unit 1

Programming life cycle and SDLC

Uploaded by

Online User
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 37

C Programming BCA-TU ict.instructor90@gmail.

com

Unit-1: Programming Language

Introduction to Programming Language

What is a language?
Language is the mechanism of communication to share ideas, thoughts, and opinions with each
other. For instance, if we want to communicate with someone, we need a language that can be any
of the languages that both the communicators’ know. It can be English, Hindi, Spanish, or another
language. But you need at least one language to communicate with someone (human/person).
What is a programming language?

Programming language is how we can talk to computers. It's a lot like English but it's kind of
quirky too. Unlike people, machines cannot guess our intent. We have to be super meticulous and
describe what we want in every little detail.

To communicate with a person, you need a language. In the same way, if you need to communicate
with the computer, you need a programming language. Without a programming language, you
cannot communicate with the computer.

A programming language is a set of rules that provide a way of telling computer what operation to
perform. A programming language include set of rules for communication. It provides a linguistic
framework for describe computations. A programming language is a notational system for
describing computation in a machine readable and human readable form. A programming
language is a tool for developing executable models for a class or problem domain. English is a
natural language, it has words, symbols and grammatical rules. Similarly each programming
language has a different set of syntax rules. Programming language can be used to create programs
that control the behavior of a computer and server any purpose.

Hence, programming language is the medium of communication between human and computer
systems. It is the set of instructions written in a specific style (coding) to instruct the computer to
perform a specific task.

History of Programming Language

Most computer programming languages were inspired by or built upon concepts from previous
computer programming languages. Today, while older languages still serve as a strong foundation
for new ones, newer computer programming languages make programmers’ work simpler

The first computer programming language was created in 1883, when a woman named Ada
Lovelace worked with Charles Babbage on his very early mechanical computer, the Analytical
Engine. While Babbage was concerned with simply computing numbers, Lovelace saw that the
numbers the computer worked with could represent something other than just amounts of things.
She wrote an algorithm for the Analytical Engine that was the first of its kind. Because of her
contribution, Lovelace is credited with creating the first computer programming language. As
1
C Programming BCA-TU [email protected]

different needs have arisen and new devices have been created, many more languages have
followed.

1883: Algorithm for the Analytical Engine: Created by Ada Lovelace for Charles Babbage’s
Analytical Engine to compute Bernoulli numbers, it’s considered to be the first computer Commented [SoI1]: Bernoulli numbers are used in
programming language. some series expansions of several
functions (trigonometric, hyperbolic, gamma,
etc.), and are extremely important in number theory
1949: Assembly Language: First widely used in the Electronic Delay Storage Automatic and analysis.
Calculator, assembly language is a type of low-level computer programming language that
simplifies the language of machine code, the specific instructions needed to tell the computer what
to do.

1952: Autocode: Autocode was a generic term for a family of early computer programming
languages. The first was developed by Alick Glennie for the Mark 1 computer at the University of
Manchester in the U.K. Some consider auto code to be the first compiled computer programming
language, meaning that it can be translated directly into machine code using a program called a
compiler.

1957: FORTRAN: A computer programming language created by John Backus for complicated
scientific, mathematical, and statistical work, FORTRAN stands for Formula Translation. It is the
one of the oldest computer programming languages still used today.

1958: Algol: Created by a committee for scientific use, Algol stands for Algorithmic Language.
Algol served as a starting point in the development of languages such as Pascal, C, C++, and Java.

1959: COBOL: Created by Dr. Grace Murray Hopper as a computer programming language
that could run on all brands and types of computers, COBOL stands
for COmmon Business Oriented Language. It is used in ATMs, credit card processing, telephone
systems, hospital and government computers, automotive systems, and traffic signals. In the
movie The Terminator, pieces of COBOL source code were used in the Terminator’s vision
display.

1959: LISP: Created by John McCarthy of MIT, LISP is still in use. It stands for LISt Processing
language. It was originally created for artificial intelligence research but today can be used in
situations where Ruby or Python are used.

1964: BASIC: Developed by John G. Kemeny and Thomas E. Kurtz at Dartmouth College so that
students who did not have a strong technical or mathematical understanding could still use
computers, it stands for Beginner’s All-purpose Symbolic Instruction Code. A modified version of
BASIC was written by Bill Gates and Paul Allen. This was to become the first Microsoft product.

1970: Pascal: Developed by Niklaus Wirth, Pascal was named in honor of the French
mathematician, physicist, and philosopher Blaise Pascal. It is easy to learn and was originally
created as a tool for teaching computer programming. Pascal was the main language used for
software development in Apple’s early years.

2
C Programming BCA-TU [email protected]

1972: Smalltalk: Developed by Alan Kay, Adele Goldberg, and Dan Ingalls at Xerox Palo Alto
Research Center, Smalltalk allowed computer programmers to modify code on the fly and also
introduced other aspects now present in common computer programming languages including
Python, Java, and Ruby.

1972: C: Developed by Dennis Ritchie at Bell Labs, C is considered by many to be the first high-
level language. A high-level computer programming language is closer to human language and
more removed from the machine code? C was created so that an operating system called UNIX
could be used on many different types of computers. It has influenced many other languages,
including Ruby, C#, Go, Java, JavaScript, Perl, PHP, and Python.

1972: SQL: SQL was developed by Donald D. Chamberlin and Raymond F. Boyce at IBM. SQL
stands for Structured Query Language. It is used for viewing and changing information that is
stored in databases. SQL uses command sentences called queries to add, remove, or view data.

1978: MATLAB: Developed by Cleve Moler. MATLAB stands for Matrix Laboratory. It is
one of the best computer programming languages for writing mathematical programs and is mainly
used in mathematics, research, and education. It can also be used to create two- and three-
dimensional graphics.
1983: Objective-C: Created by Brad Cox and Tom Love, Objective-C is the main computer
programming language used when writing software for macOS and iOS, Apple’s operating
systems.
1983: C++: C++ is an extension of the C language and was developed by Bjarne Stroustrup. It is
one of the most widely used languages in the world. C++ is used in game engines and high-
performance software like Adobe Photoshop. Most packaged software is still written in C++.
1987: Perl: Perl was originally developed by Larry Wall in 1987 as a scripting language designed
for text editing. Its purpose was to make report processing easier. It is now widely used for many
purposes, including Linux system administration, Web development, and network programming.
1990: Haskell: Named after Haskell Brooks Curry, an American logician and mathematician.
Haskell is called a purely functional computer programming language, which basically means that
it is mostly mathematical. It is used by many industries, especially those that deal with complicated
calculations, records, and number-crunching.

3
C Programming BCA-TU [email protected]

1991: Python: Designed by Guido Van Rossum, Python is easier to read and requires fewer lines
of code than many other computer programming languages. It was named after the British comedy
group Monty Python. Popular sites like Instagram use frameworks that are written in Python.
1991: Visual Basic: Developed by Microsoft, Visual Basic allows programmers to choose and
change pre-selected chunks of code in a drag-and-drop fashion through a graphical user interface
(GUI).
1993: R: Developed by Ross Ihaka and Robert Gentleman at the University Of Auckland, New
Zealand, R is named after the first names of the first two authors. It is mostly used by statisticians
and those performing different types of data analysis.
1994: PHP: Created by Rasmus Lerdorf, PHP is used mostly for Web development and is usually
run on Web servers. It originally stood for Personal Home Page, as it was used by Lerdorf to
manage his own online information. PHP is now widely used to build websites and blogs.
WordPress, a popular website creation tool, is written using PHP.
1995: Java: Originally called Oak, Java was developed by Sun Microsystems. It was intended for
cable boxes and hand-held devices but was later enhanced so it could be used to deliver information
on the World Wide Web. Java is everywhere, from computers to smartphones to parking meters.
Three billion devices run Java!
1995: Ruby: Ruby was created by Yukihiro “Matz” Matsumoto, who combined parts of his
favorite languages to form a new general-purpose computer programming language that can
perform many programming tasks. It is popular in Web application development. Ruby code
executes more slowly, but it allows for computer programmers to quickly put together and run a
program.
1995: JavaScript: Created in just 10 days by Brendan Eich, this language is mostly used to
enhance many Web browser interactions. Almost every major website uses JavaScript.
2000: C#: Developed by Microsoft with the goal of combining the computing ability of C++ with
the simplicity of Visual Basic, C# is based on C++ and is similar to Java in many aspects. It is
used in almost all Microsoft products and is primarily used for developing desktop applications.
2003: Scala: Created by Martin Odersky. Scala is a computer programming language that
combines functional programming, which is mathematical, with object-oriented programming,
which is organized around data that controls access to code. Its compatibility with Java makes it
helpful in Android development.

2003: Groovy: Developed by James Strachan and Bob McWhirter, Groovy is derived from Java
and improves the productivity of developers because it is easy to learn and concise.
2009: Go: Go was developed by Google to address problems that can occur in large software
systems. Since computer and technology use is much different today than it was when languages
such as C++, Java, and Python were introduced and put to use, problems arose when huge
computer systems became common. Go was intended to improve the working environment for
programmers so they could write, read, and maintain large software systems more efficiently.

4
C Programming BCA-TU [email protected]

2009:Node.js: Node.js was written initially by Ryan Dahl in 2009, about thirteen years after the
introduction of the first server-side JavaScript environment, Netscape's LiveWire Pro Web. The
initial release supported only Linux and Mac OS X. Its development and maintenance was led by
Dahl and later sponsored by Joyent.
2011: React: It was created by Jordan Walke, a software engineer at Facebook, who released an
early prototype of React called "FaxJS". He was influenced by XHP, an HTML component library
for PHP. It was first deployed on Facebook's News Feed in 2011 and later on Instagram in 2012.
It was open-sourced at JSConf US in May 2013.
2011: Dart: The project was founded by Lars Bak and Kasper Lund. Dart is a client-optimized
programming language for apps on multiple platforms. It is developed by Google and is used to
build mobile, desktop, server, and web applications. Dart is an object-oriented, class-based,
garbage-collected language with C-style syntax. Dart can compile to either native code or
JavaScript.
2014: Swift: Developed by Apple as a replacement for C, C++, and Objective-C, Swift is
supposed to be easier to use and allows less room for mistakes. It is versatile and can be used for
desktop and mobile apps and cloud services.

Types of Programming Language

From the first generation and now fourth generation of the Computers there were several
programming languages used to communicate with the Computer. Different types of programming
language are:
 Low level language
o Machine language (1 GL)
o Assembly language (2 GL)
 High level language
o Procedural oriented language (3 GL)
o Problem oriented language (4 GL)
o Natural language (5 GL)

1. Low level language


Low level languages are the machine codes in which the instructions are given in machine
language in the form of 0 and 1 to a Computer system. It is mainly designed to operate and
handle all the hardware and instructions set architecture of a Computer. The main function of
the Low level language is to operate, manage and manipulate the hardware and system
components. Low level language is also divided into two parts are Machine language and
Assembly language.
1.1. Machine Language (1GL):
Machine language consists of strings of binary numbers (i.e. 0s and 1s) and it is the only one
language, the processor directly understands. Machine language has a merits of very fast
execution speed and efficient use of primary memory. Machine Language is one of the low-
level programming languages which is the first generation language developed for

5
C Programming BCA-TU [email protected]

communicating with a Computer. It is written in machine code which represents 0 and 1 binary
digits inside the Computer string which makes it easy to understand and perform the
operations. As we know a Computer system can recognize electric signals so here 0 stands for
turning off electric pulse and 1 stands for turning on electric pulse. It is very easy to understand
by the Computer and also increases the processing speed.
Advantages:
 The main advantage of using Machine language is that there is no need of a translator or
interpreter to translate the code, as the Computer directly can understand.
 It is directly understood by the processor so has faster execution time since the programs
written in this language need not to be translated.
 It doesn’t need larger memory
Disadvantages:
 It is very difficult to program using 1GL since all the instructions are to be represented by
0s and 1s.
 Use of this language makes programming time consuming.
 It is difficult to find error and to debug.
 It can be used by experts only.

1.2. Assembly Language (2 GL)


Assembly Language is the second generation programming language that has almost similar
structure and set of commands as Machine language. Instead of using numbers like in
Machine languages here we use words or names in English forms and also symbols. The
programs that have been written using words, names and symbols in assembly language are
converted to machine language using an Assembler. Because a Computer only understands
machine code languages that’s why we need an Assembler that can convert the Assembly
level language to Machine language so the Computer gets the instruction and responds
quickly.

Assembly language is also known as low-level language because to design a program


programmer requires detailed knowledge of hardware specification. This language uses
mnemonics code (symbolic operation code like ‘ADD’ for addition) in place of 0s and 1s.
The program is converted into machine code by assembler. The resulting program is referred
to as an object code.
Advantages:
 It is makes programming easier than 1GL since it uses mnemonics code for
programming. Ex: ADD for addition, SUB for subtraction, DIV for division, etc.
 It makes programming process faster.
 Error can be identified much easily compared to 1GL.
 It is easier to debug than machine language.
Disadvantages:
 Programs written in this language is not directly understandable by computer so
translators should be used.
 It is hardware dependent language so programmers are forced to think in terms of
computer’s architecture rather than to the problem being solved.

6
C Programming BCA-TU [email protected]

 Being machine dependent language, programs written in this language are very less or
not portable.
 Programmers must know its mnemonics codes to perform any task.

2. High level language


As a requirement of the developing a fast and easy language for developer to understand,
high level language comes in existence. Instructions of this language closely resembles to
human language or English like words. It uses mathematical notations to perform the
task. The high level language is easier to learn. It requires less time to write and is easier
to maintain the errors. The high level language is converted into machine language by
one of the two different languages translator programs; interpreter or compiler. High
level language can be further categorized as:

2.1. Procedural-Oriented language (3GL)


Procedural Programming is a methodology for modeling the problem being solved, by
determining the steps and the order of those steps that must be followed in order to reach
a desired outcome or specific program state. These languages are designed to express the
logic and the procedure of a problem to be solved. It includes languages such as Pascal,
COBOL, C, FORTAN, etc.

Advantages:

 Because of their flexibility, procedural languages are able to solve a variety of


problems.
 Programmer does not need to think in term of computer architecture which makes
them focused on the problem.
 Programs written in this language are portable.
Disadvantages:

 It is easier but needs higher processor and larger memory.


 It needs to be translated therefore its execution time is more.

2.2. Problem-Oriented language (4GL)


It allows the users to specify what the output should be, without describing all the details
of how the data should be manipulated to produce the result. This is one step ahead from
3GL. These are result oriented and include database query language. Example: Visual
Basic, C#, PHP, etc.
The objectives of 4GL are to:
 Increase the speed of developing programs.
 Minimize user’s effort to obtain information from computer.
 Reduce errors while writing programs.
Advantages:
 Programmer need not to think about the procedure of the program. So,
programming is much easier.

7
C Programming BCA-TU [email protected]

Disadvantages:
 It is easier but needs higher processor and larger memory.
 It needs to be translated therefore its execution time is more.

2.3. Natural language (5GL)


Natural language are still in developing stage where we could write statements that would
look like normal sentences. Fifth generation language are used into area of research,
robotics, defense system, artificial intelligence and different type of expert systems.
Prolog, Smalltalk, OPS5, Mercury are the example of fifth generation language.
Advantages:
 Easy to program.
 Since, the program uses normal sentences, they are easy to understand.
 The programs designed using 5GL will have artificial intelligence (AI).
 The programs would be much more interactive and interesting.
Disadvantages:
 It is slower than previous generation language as it should be completely
translated into binary code which is a tedious task.
 Highly advanced and expensive electronic devices are required to run programs
developed in 5GL. Therefore, it is an expensive approach.

Language Processor

As we studied about different types of programming language which can be written to perform
certain task. The programs are written mostly in high level languages like Java, C++, and Python
etc. and are called source code. These source code cannot be executed directly by the computer
and must be converted into machine language to be executed because a computer understands
instructions in machine code, i.e. in the form of 0s and 1s. Hence, a special translator system
software is used to translate the program written in high-level language into machine code is
called Language Processor is needed which translate into machine code (object program / object
code). Hence Language processor is a special types of software application which is designed or
used to perform tasks such as processing program code or source code into machine code.
Different types of language processor are:
 Compiler
 Interpreter
 Assembler
Compiler
A compiler is a program that converts the instructions of high-level language into machine
language as a whole. The language processor that reads the complete source program written in
high level language as a whole in one time and translates it into an equivalent program in machine
language is called as a Compiler. The source code is translated to object code successfully if it is
free of errors. The compiler specifies the errors at the end of compilation with line numbers when

8
C Programming BCA-TU [email protected]

there are any errors in the source code. The errors must be removed before the compiler can
successfully recompile the source code again. Language like C, C++, C#, Java use compiler.

Advantages

 Producers and executable file, and therefore the program can be run without need of the
source code.
 A compiler converts a high-level program that can be executed many times.

Disadvantages

 It is slow to execute as you have to finish the whole program.


 It is not easy to debug as errors are shown at the end of the execution.

Interpreter
An interpreter is a computer program that performs a translation of high level programming
language code to low level language machine code. The translation of single statement of source
program into machine code is done by language processor and executes it immediately before
moving on to the next line is called an interpreter. If there is an error in the statement, the interpreter
terminates its translating process at that statement and displays an error message. The interpreter
moves on to the next line for execution only after removal of the error. An Interpreter directly
executes instructions written in a programming or scripting language without previously
converting them to an object code or machine code. Interpreter is slower than compiler. First
interpreter convert source code to intermediate code and then execute it line by line. Language
like Perl, Python and MATLAB, PHP use interpreter.

Advantages

 Interpreter is that it makes easy to trace out and correct errors in the source program.
 Interpreters over compilers are that an error is found immediately.

9
C Programming BCA-TU [email protected]

Disadvantages

 It is a time consuming process of translating and executing statements one by one.


 Programs execution is slow.

Assembler

The Assembler is used to convert the program written in Assembly language program into machine
code. The source program is an input of assembler that contains assembly language instructions.
The output generated by assembler is the object code or machine code understandable by the
computer.

Advantages

 Assembler is Very fast translating assembly language to machine code as 1 to 1


relationship.
 Efficiency in execution just like machine level language.

Disadvantages

 Assembly language is difficult to understand. It is a low-level programming language.


 It is difficult to maintain.

Difference between Compiler and Interpreter

Compiler Interpreter

A compiler takes the whole program as a single unit and Interpreter each line in translated or converted one by one
compiles it at once and executed

It stores an object file. It does not store an object file.

Occupies more memory space Occupies less memory space

Program execution is very fast. Program execution is slow.

Debugging is harder Debugging is easier

10
C Programming BCA-TU [email protected]

Compiler Interpreter

Translator program is required to translate the program Translator program is not required to translate the
each time you want to run the program. program each time you want to run the program.

More useful for commercial purpose More useful for learning purpose

Costlier then interpreter Cheaper than compiler

Compiler are good for a very long program Interpreter is good for small programs.

Example :C compiler, PASCAL compiler, FORTRAN Example : Basic interpreter, Prolog interpreter, LISP,
compiler etc. APL, Perl, Python, PHP etc.

Program
A computer program is the expression, in a certain language, of a calculation or procedure - but also the
expression of certain objects.
In simple word, Program is an organized specific set of ordered instructions which is written to perform
specific task or operation. A collection of interrelated program is used to create software program for
specific domain. Typically, the program is put into a storage area accessible to the computer. The computer
gets one instruction and performs it and then gets the next instruction. The storage area or memory can also
contain the data that the instruction operates on.
When you create a program, you write it using some kind of computer language. Your language statements
are the source program. You then "compile" the source program (with a special program called a language
compiler) and the result is called an object program (not to be confused with object-oriented programming).
There are several synonyms for object program, including object module and compiled program. The object
program contains the string of 0s and 1s called machine language that the logic processor works with.

Feature of good program

Every computer requires appropriate instruction set (programs) to perform the required task. The quality of
the processing depends upon the given instructions. If the instructions are improper or incorrect, then it is
obvious that the result will be superfluous.
Therefore, proper and correct instructions should be provided to the computer so that it can provide the
desired output. Hence, a program should be developed in such a way that it ensures proper functionality of
the computer. In addition, a program should be written in such a manner that it is easier to understand the
underlying logic.
A good computer program should have following characteristics:
 Efficiency: Every program requires certain processing time and memory to process the instructions
and data. As the processing power and memory are the most precious resources of a computer, a

11
C Programming BCA-TU [email protected]

program should be laid out in such a manner that it utilizes the least amount of memory and
processing time.

 Portability: Portability refers to the ability of an application to run on different platforms


(operating systems) with or without minimal changes. Due to rapid development in the hardware
and the software, nowadays platform change is a common phenomenon. Hence, if a program is
developed for a particular platform, then the life span of the program is severely affected.

 Structural: To develop a program, the task must be broken down into a number of subtasks. These
subtasks are developed independently, and each subtask is able to perform the assigned job without
the help of any other subtask. If a program is developed structurally, it becomes more readable, and
the testing and documentation process also gets easier.

 Readability: The program should be written in such a way that it makes other programmers or
users to follow the logic of the program without much effort. If a program is written structurally, it
helps the programmers to understand their own program in a better way. Even if some
computational efficiency needs to be sacrificed for better readability, it is advisable to use a more
user-friendly approach, unless the processing of an application is of utmost importance.

 Flexibility: A program should be flexible enough to handle most of the changes without having to
rewrite the entire program. Most of the programs are developed for a certain period and they require
modifications from time to time. For example, in case of payroll management, as the time
progresses, some employees may leave the company while some others may join. Hence, the
payroll application should be flexible enough to incorporate all the changes without having to
reconstruct the entire application.

 Generality: Apart from flexibility, the program should also be general. Generality means that if a
program is developed for a particular task, then it should also be used for all similar tasks of the
same domain. For example, if a program is developed for a particular organization, then it should
suit all the other similar organizations.
 Documentation: Documentation is one of the most important components of an application
development. Even if a program is developed following the best programming practices, it will be
rendered useless if the end user is not able to fully utilize the functionality of the application. A
well-documented application is also useful for other programmers because even in the absence of
the author, they can understand it.

Error in Program

Errors are the mistakes or faults in the program that causes our program to behave unexpectedly
and it is no doubt that the well versed and experienced programmers also makes mistakes.
Programming error are generally known as Bugs and the process to remove bugs from program is
called as Debug/Debugging.
Also, error is an illegal operation performed by the user which results in abnormal working of the
program. Programming errors often remain undetected until the program is compiled or executed.

12
C Programming BCA-TU [email protected]

Some of the errors prevent the program from getting compiled or executed. Thus errors should be
removed before compiling and executing.
Syntax errors
Errors that occur when you violate the rules of writing C/C++ syntax are known as syntax errors.
This compiler error indicates something that must be fixed before the code can be compiled. All
these errors are detected by compiler and thus are known as compile-time errors.
Most frequent syntax errors are:
 Missing Parenthesis (})
 Printing the value of variable without declaring it
 Missing semicolon
 Incorrect format in selection and loop statement
 Unmatched parenthesis, square brackets and curly braces

// syntax error
#include<stdio.h>
void main()
{
int x = 10;
int y = 15 // missing semicolon
printf("%d", (x, y));
}

Runtime error
Run Time errors are generated when the program is running and leads to the abnormal behavior or
termination of the program. The general cause of Run time errors is because your program is trying
to perform an operation that is impossible to carry out.
Example: Dividing any number by zero, accessing any file that doesn't exist etc. are common
examples of such error. These types of error are hard to find as the compiler doesn’t point to the
line at which the error occurs.
#include<stdio.h>

void main()

int n = 9, div = 0;

// wrong logic

// number is divided by 0, so this program abnormally terminates

div = n/0;

printf("resut = %d", div);

13
C Programming BCA-TU [email protected]

Linker Error
Linker error are generated when the linker encounters what looks like a function call; but it cannot
find a function with that name. This is usually caused by misspelling a C standard function (like
main) or not including the header file for the function. These are errors generated when the
executable of the program cannot be generated. This may be due to wrong function prototyping,
incorrect header files.
 Missing a C standard main function
 Not including a header file for a function.
#include<stdio.h>

void Main() // Here Main() should be main()

int a = 10;

printf("%d", a);

Logical Error
Logical error will cause your program to perform undesired operations which you didn't intended
your program to perform. These errors occur generally due to improper logic used in program.
These types of errors are difficult to debug. These are one of the most common errors done by
beginners of programming. These errors solely depend on the logical thinking of the programmer
and are easy to detect if we follow the line of execution and determine why the program takes that
path of execution.
Example: Multiplying an uninitialized integer value with some other value will result in undesired
output.
#include<stdio.h>
int main()
{
int i = 0;
for(i = 0; i < 3; i++); // logical error : a semicolon after loop
{
printf("loop ");
continue;
}
getchar();
return 0;
}

14
C Programming BCA-TU [email protected]

Semantic Errors
This error occurs when the statements written in the program are not meaningful to the compiler.
#include<stdio.h>

void main()

int a, b, c;

a + b = c; //semantic error

Software development model

Software:
Software is a set of instructions, data or programs used to operate computers and execute specific
tasks. Software comprises the entire set of programs, procedures, and routines associated with the
operation of a computer system. A set of instructions that directs a computer’s hardware to perform
a task is called a program, or software program.
Software development model
Software development model is process of constructing the software depending upon the situation.
A software development process is the process of dividing software development work into
different phases to improve design, product quality, and project management.
Waterfall Model
 The Waterfall Model was first Process Model to be introduced.
 It is also referred to as a linear-sequential life cycle model.
 It is very simple to understand and use.
 In a waterfall model, each phase must be completed fully before the next phase can begin.
 This type of software development model is basically used for the project which is small
and there are no uncertain requirements.
 At the end of each phase, a review takes place to determine if the project is on the right
path and whether or not to continue or discard the project.
 In this model software testing starts only after the development is complete. In waterfall
model phases do not overlap.

15
C Programming BCA-TU [email protected]

Fig: Waterfall model


Advantages of waterfall model

 This model is simple and easy to understand and use.


 It is easy to manage due to the rigidity of the model – each phase has specific deliverables
and a review process.
 In this model phases are processed and completed one at a time. Phases do not overlap.
 Waterfall model works well for smaller projects where requirements are clearly defined
and very well understood.

Disadvantages of waterfall model

 Once an application is in the testing stage, it is very difficult to go back and change
something that was not well-thought out in the concept stage.
 No working software is produced until late during the life cycle.
 High amounts of risk and uncertainty.
 Not a good model for complex and object-oriented projects.
 Poor model for long and ongoing projects.
 Not suitable for the projects where requirements are at a moderate to high risk of changing.

16
C Programming BCA-TU [email protected]

When to use the waterfall model

 This model is used only when the requirements are very well known, clear and fixed.
 Product definition is stable.
 Technology is understood.
 There are no ambiguous requirements.
 Ample resources with required expertise are available freely.
 The project is short.

Incremental Model
 In incremental model the whole requirement is divided into various builds.
 Multiple development cycles take place here, making the life cycle a “multi-waterfall”
cycle.
 Cycles are divided up into smaller, more easily managed modules.
 In this model, each module passes through the requirements, design, implementation
and testing phases.
 A working version of software is produced during the first module, so you have working
software early on during the software life cycle.
 Each subsequent release of the module adds function to the previous release. The process
continues till the complete system is achieved.

Fig: Incremental Model


Advantages of Incremental model:
 Generates working software quickly and early during the software life cycle.
 This model is more flexible – less costly to change scope and requirements.
 It is easier to test and debug during a smaller iteration.
 In this model customer can respond to each built.
 Lowers initial delivery cost.
 Easier to manage risk because risky pieces are identified and handled during it’s iteration.

17
C Programming BCA-TU [email protected]

Disadvantages of Incremental model:


 Needs good planning and design.
 Needs a clear and complete definition of the whole system before it can be broken down
and built incrementally.
 Total cost is higher than waterfall.
When to use the Incremental model:
 This model can be used when the requirements of the complete system are clearly defined
and understood.
 Major requirements must be defined; however, some details can evolve with time.
 There is a need to get a product to the market early.
 A new technology is being used.
 Resources with needed skill set are not available.
 There are some high risk features and goals.
RAD (Rapid Application Development) Model

 RAD model is Rapid Application Development model.


 It is a type of incremental model.
 In RAD model the components or functions are developed in parallel as if they were mini
projects.
 The developments are time boxed, delivered and then assembled into a working prototype.
 This can quickly give the customer something to see and use and to provide feedback
regarding the delivery and their requirements.
The phases in the rapid application development (RAD) model are:
 Business modeling: The information flow is identified between various business
functions.
 Data modeling: Information gathered from business modeling is used to define data
objects that are needed for the business.
 Process modeling: Data objects defined in data modeling are converted to achieve the
business information flow to achieve some specific business objective. Description are
identified and created for CRUD of data objects.
 Application generation: Automated tools are used to convert process models into code
and the actual system.
 Testing and turnover: Test new components and all the interfaces.

18
C Programming BCA-TU [email protected]

Fig: Rapid Application Development Model

Advantages of the RAD model:


 Reduced development time.
 Increases reusability of components
 Quick initial reviews occur
 Encourages customer feedback
 Integration from very beginning solves a lot of integration issues.
Disadvantages of RAD model:
 Depends on strong team and individual performances for identifying business
requirements.
 Only system that can be modularized can be built using RAD
 Requires highly skilled developers/designers.
 High dependency on modeling skills
 Inapplicable to cheaper projects as cost of modeling and automated code generation is very
high.

19
C Programming BCA-TU [email protected]

When to use RAD model:


 RAD should be used when there is a need to create a system that can be modularized in 2-
3 months of time.
 It should be used if there’s high availability of designers for modeling and the budget is
high enough to afford their cost along with the cost of automated code generating tools.
 RAD SDLC model should be chosen only if resources with high business knowledge are
available and there is a need to produce the system in a short span of time (2-3 months).
Prototype model
 The basic idea in Prototype model is that instead of freezing the requirements before a
design or coding can proceed, a throwaway prototype is built to understand the
requirements.
 This prototype is developed based on the currently known requirements.
 By using this prototype, the client can get an “actual feel” of the system, since the
interactions with prototype can enable the client to better understand the requirements of
the desired system.
 Prototyping is an attractive idea for complicated and large systems for which there is no
manual process or existing system to help determining the requirements.
 The prototype are usually not complete systems and many of the details are not built in the
prototype.
 The goal is to provide a system with overall functionality.

Fig: Prototype model


Advantages of Prototype model:
 Users are actively involved in the development
 Since in this methodology a working model of the system is provided, the users get a better
understanding of the system being developed.
 Errors can be detected much earlier.
 Quicker user feedback is available leading to better solutions.
 Missing functionality can be identified easily
 Confusing or difficult functions can be identified Requirements validation, Quick
implementation of, incomplete, but functional, application.

20
C Programming BCA-TU [email protected]

Disadvantages of Prototype model:


 Leads to implementing and then repairing way of building systems.
 Practically, this methodology may increase the complexity of the system as scope of the
system may expand beyond original plans.
 Incomplete application may cause application not to be used as the full system was
designed Incomplete or inadequate problem analysis.
When to use Prototype model:
 Prototype model should be used when the desired system needs to have a lot of interaction
with the end users.
 Typically, online systems, web interfaces have a very high amount of interaction with end
users, are best suited for Prototype model. It might take a while for a system to be built that
allows ease of use and needs minimal training for the end user.
 Prototyping ensures that the end users constantly work with the system and provide a
feedback which is incorporated in the prototype to result in a useable system. They are
excellent for designing good human computer interface systems.
Spiral model
 The spiral model is similar to the incremental model, with more emphasis placed on risk
analysis.
 The spiral model has four phases: Planning, Risk Analysis, Engineering and Evaluation.
 A software project repeatedly passes through these phases in iterations (called Spirals in
this model).
 The baseline spiral, starting in the planning phase, requirements are gathered and risk is
assessed. Each subsequent spirals builds on the baseline spiral.
Planning Phase: Requirements are gathered during the planning phase. Requirements like ‘BRS’
that is ‘Business Requirement Specifications’ and ‘SRS’ that is ‘System Requirement
specifications’.
Risk Analysis: In the risk analysis phase, a process is undertaken to identify risk and alternate
solutions. A prototype is produced at the end of the risk analysis phase. If any risk is found during
the risk analysis then alternate solutions are suggested and implemented.
Engineering Phase: In this phase software is developed, along with testing at the end of the phase.
Hence in this phase the development and testing is done.
Evaluation phase: This phase allows the customer to evaluate the output of the project to date
before the project continues to the next spiral.

21
C Programming BCA-TU [email protected]

Fig: Spiral Model


Advantages of Spiral model:
 High amount of risk analysis hence, avoidance of Risk is enhanced.
 Good for large and mission-critical projects.
 Strong approval and documentation control.
 Additional Functionality can be added at a later date.
 Software is produced early in the software life cycle.
Disadvantages of Spiral model:
 Can be a costly model to use.
 Risk analysis requires highly specific expertise.
 Project’s success is highly dependent on the risk analysis phase.
 Doesn’t work well for smaller projects.
When to use Spiral model:
 When costs and risk evaluation is important
 For medium to high-risk projects
 Long-term project commitment unwise because of potential changes to economic priorities
 Users are unsure of their needs
 Requirements are complex
 Significant changes are expected (research and exploration)

22
C Programming BCA-TU [email protected]

V-model
 V- Model means Verification and Validation model. Just like the waterfall model, the V-
Shaped life cycle is a sequential path of execution of processes. Each phase must be
completed before the next phase begins.
 Testing of the product is planned in parallel with a corresponding phase of development
in V-model.
 It is an extension of the waterfall model, Instead of moving down in a linear way, the
process steps are bent upwards after the implementation and coding phase, to form the
typical V shape.
 The major difference between the V-shaped model and waterfall model is the early test
planning in the V-shaped model.

Fig: V-Model
Advantages of V-model:
 Simple and easy to use.
 Testing activities like planning, test designing happens well before coding. This saves a lot
of time. Hence higher chance of success over the waterfall model.
 Proactive defect tracking – that is defects are found at early stage.
 Avoids the downward flow of the defects.
 Works well for small projects where requirements are easily understood.
Disadvantages of V-model:
 Very rigid and least flexible.
 Software is developed during the implementation phase, so no early prototypes of the
software are produced.
 If any changes happen in midway, then the test documents along with requirement
documents has to be updated.

23
C Programming BCA-TU [email protected]

When to use the V-model:


 The V-shaped model should be used for small to medium sized projects where
requirements are clearly defined and fixed.
 The V-Shaped model should be chosen when ample technical resources are available with
needed technical expertise.
Agile model
 Agile development model is also a type of Incremental model.
 Software is developed in incremental, rapid cycles. This results in small incremental
releases with each release building on previous functionality. Each release is
thoroughly tested to ensure software quality is maintained.
 It is used for time critical applications. Extreme Programming (XP) is currently one of the
most well-known agile development life cycle model.

Fig: Agile Model


Advantages of Agile model:
 Customer satisfaction by rapid, continuous delivery of useful software.
 People and interactions are emphasized rather than process and tools.
 Customers, developers and testers constantly interact with each other.
 Working software is delivered frequently (weeks rather than months).
 Face-to-face conversation is the best form of communication.
 Close, daily cooperation between business people and developers.
 Continuous attention to technical excellence and good design.
 Regular adaptation to changing circumstances.
 Even late changes in requirements are welcomed

24
C Programming BCA-TU [email protected]

Disadvantages of Agile model:


 In case of some software deliverables, especially the large ones, it is difficult to assess the
effort required at the beginning of the software development life cycle.
 There is lack of emphasis on necessary designing and documentation.
 The project can easily get taken off track if the customer representative is not clear what
final outcome that they want.
 Only senior programmers are capable of taking the kind of decisions required during the
development process. Hence it has no place for newbie programmers, unless combined
with experienced resources.
When to use agile model:
 When new changes are needed to be implemented. The freedom agile gives to change is
very important. New changes can be implemented at very little cost because of the
frequency of new increments that are produced.
 To implement a new feature the developers need to lose only the work of a few days, or
even only hours, to roll back and implement it.
 Unlike the waterfall model in agile model very limited planning is required to get started
with the project. Agile assumes that the end users’ needs are ever changing in a dynamic
business and IT world. Changes can be discussed and features can be newly effected or
removed based on feedback. This effectively gives the customer the finished system they
want or need.
 Both system developers and stakeholders alike, find they also get more freedom of time
and options than if the software was developed in a more rigid sequential way. Having
options gives them the ability to leave important decisions until more or better data or even
entire hosting programs are available; meaning the project can continue to move forward
without fear of reaching a sudden standstill.

Program development life cycle

When we want to develop a program using any programming language, we follow a sequence of
steps. These steps are called phases in program development. The program development life cycle
is a set of steps or phases that are used to develop a program in any programming language.
Generally, the program development life cycle contains 6 phases.
 Problem Definition
 Problem Analysis
 Algorithm Development
 Coding & Documentation
 Testing & Debugging
 Maintenance

25
C Programming BCA-TU [email protected]

Fig: Program development life cycle.


Problem Definition
In this phase, we define the problem statement and we decide the boundaries of the problem. In
this phase we need to understand the problem statement, what is our requirement, what should be
the output of the problem solution? These are defined in this first phase of the program
development life cycle.
Problem Analysis
In this phase, we determine the requirements like variables, functions, etc. to solve the problem.
That means we gather the required resources to solve the problem defined in the problem definition
phase. We also determine the bounds of the solution.
Algorithm Development
During this phase, we develop a step by step procedure to solve the problem using the specification
given in the previous phase. This phase is very important for program development. That means
we write the solution in step by step statements.
Coding & Documentation

26
C Programming BCA-TU [email protected]

This phase uses a programming language to write or implement the actual programming
instructions for the steps defined in the previous phase. In this phase, we construct the actual
program. That means we write the program to solve the given problem using programming
languages like C, C++, Java, etc.
Testing & Debugging
During this phase, we check whether the code written in the previous step is solving the specified
problem or not. That means we test the program whether it is solving the problem for various input
data values or not. We also test whether it is providing the desired output or not.
Maintenance
During this phase, the program is actively used by the users. If any enhancements found in this
phase, all the phases are to be repeated to make the enhancements. That means in this phase, the
solution (program) is used by the end-user. If the user encounters any problem or wants any
enhancement, then we need to repeat all the phases from the starting, so that the encountered
problem is solved or enhancement is added.

Programming Paradigms

 A programming paradigm is a style, or “way,” of programming.


 Paradigm can also be termed as method to solve some problem or do some task.
 Programming paradigm is an approach to solve problem using some programming
language or also we can say it is a method to solve a problem using tools and techniques
that are available to us following some approach.
 There are lots for programming language that are known but all of them need to follow
some strategy when they are implemented and this methodology/strategy is paradigms.
Apart from varieties of programming language there are lots of paradigms to fulfil each
and every demand.
 Paradigm is a school of thought or model that has distinct features, frameworks, patterns,
and style which help you solve a particular problem.
Different programming paradigms are:
 Imperative programming paradigm:
o Procedural programming
o Object oriented programming
o Parallel processing approach
 Declarative programming paradigm
o Logical programming
o Functional programming
o Database programming approach

27
C Programming BCA-TU [email protected]

Imperative programming paradigm:


 It is one of the oldest programming paradigm.
 It features close relation to machine architecture.
 It is based on Von Neumann architecture.
 It works by changing the program state through assignment statements.
 It performs step by step task by changing state.
 The main focus is on how to achieve the goal.
 The paradigm consist of several statements and after execution of all the result is stored.
Advantage:
 Very simple to implement
 It contains loops, variables etc.
Disadvantage:
 Complex problem cannot be solved
 Less efficient and less productive
 Parallel programming is not possible
Examples of Imperative programming paradigm:
 C : developed by Dennis Ritchie and Ken Thompson
 Fortan : developed by John Backus for IBM
 Basic : developed by John G Kemeny and Thomas E Kurtz
Imperative programming is divided into three categories: Procedural, OOP and parallel
processing.
Procedural programming paradigm

This paradigm emphasizes on procedure in terms of under lying machine model. There is no
difference in between procedural and imperative approach. It has the ability to reuse the code and
it was boon at that time when it was in use because of its reusability.
Examples of Procedural programming paradigm:
 C : developed by Dennis Ritchie and Ken Thompson
 C++ : developed by Bjarne Stroustrup
 Java : developed by James Gosling at Sun Microsystems
 ColdFusion : developed by J J Allaire
 Pascal : developed by Niklaus Wirth
Object oriented programming

The program is written as a collection of classes and object which are meant for communication.
The smallest and basic entity is object and all kind of computation is performed on the objects
only. More emphasis is on data rather procedure. It can handle almost all kind of real life problems
which are today in scenario.

28
C Programming BCA-TU [email protected]

Advantages:
 Data security
 Inheritance
 Code reusability
 Flexible and abstraction is also present
Examples of Object Oriented programming paradigm:
 Simula : first OOP language
 Java : developed by James Gosling at Sun Microsystems
 C++ : developed by Bjarne Stroustrup
 Objective-C : designed by Brad Cox
 Visual Basic .NET : developed by Microsoft
 Python : developed by Guido van Rossum
 Ruby : developed by Yukihiro Matsumoto
 Smalltalk : developed by Alan Kay, Dan Ingalls, Adele Goldberg

Parallel processing approach

Parallel processing is the processing of program instructions by dividing them among multiple
processors. A parallel processing system possess many numbers of processor with the objective
of running a program in less time by dividing them. This approach seems to be like divide and
conquer. Examples are NESL (one of the oldest one) and C/C++ also supports because of some
library function.

Declarative programming paradigm:


 It is divided as Logic, Functional, and Database.
 In computer science the declarative programming is a style of building programs that
expresses logic of computation without talking about its control flow.
 It often considers programs as theories of some logic.
 It may simplify writing parallel programs. The focus is on what needs to be done rather
how it should be done basically emphasize on what code is actually doing.
 It just declare the result we want rather how it has be produced.
 This is the only difference between imperative (how to do) and declarative (what to do)
programming paradigms.
Logic programming paradigms
 It can be termed as abstract model of computation. It would solve logical problems like
puzzles, series etc.
 In logic programming we have a knowledge base which we know before and along with
the question and knowledge base which is given to machine, it produces result.

29
C Programming BCA-TU [email protected]

 In normal programming languages, such concept of knowledge base is not available but
while using the concept of artificial intelligence, machine learning we have some models
like Perception model which is using the same mechanism.
 In logical programming the main emphasize is on knowledge base and the problem. The
execution of the program is very much like proof of mathematical statement, e.g., Prolog

Functional programming paradigms –


 The functional programming paradigms has its roots in mathematics and it is language
independent.
 The key principal of this paradigms is the execution of series of mathematical functions.
 The central model for the abstraction is the function which are meant for some specific
computation and not the data structure.
 Data are loosely coupled to functions. The function hide their implementation. Function
can be replaced with their values without changing the meaning of the program. Examples
of Functional programming paradigm:
Example of functional paradigms
 JavaScript : developed by Brendan Eich
 Haskwell : developed by Lennart Augustsson, Dave Barton
 Scala : developed by Martin Odersky
 Erlang : developed by Joe Armstrong, Robert Virding
 Lisp : developed by John Mccarthy
 ML : developed by Robin Milner
 Clojure : developed by Rich Hickey

Database/Data driven programming


 This programming methodology is based on data and its movement.
 Program statements are defined by data rather than hard-coding a series of steps.
 A database program is the heart of a business information system and provides file creation,
data entry, update, query and reporting functions. There are several programming
languages that are developed mostly for database application.
 For example SQL. It is applied to streams of structured data, for filtering, transforming,
aggregating (such as computing statistics), or calling other programs. So it has its own wide
application.

System design tools

Software analysis and design includes all activities, which help the transformation of requirement
specification into implementation. Requirement specifications specify all functional and non-

30
C Programming BCA-TU [email protected]

functional expectations from the software. These requirement specifications come in the shape of
human readable and understandable documents, to which a computer has nothing to do.
Software analysis and design is the intermediate stage, which helps human-readable requirements
to be transformed into actual code.

System design tools are shapes, symbols, tables or human readable and understandable documents
which represent flow of system, components of system, conditions and actions to be taken while
implementing into the code.
It is the intermediate stage, which helps human-readable requirements to be transformed into actual
code and can be used to various types computer software to design.
Let us see system design tools used by software designers:
 Data flow diagram
 ER diagram (Entity Relationship)
 Data Dictionary
 Pseudocode
 Algorithm
 Flowchart
 Decision table

Data Flow Diagram


Data flow diagram is graphical representation of flow of data in an information system. It is
capable of representing incoming data flow, outgoing data flow and stored data.
There is a prominent difference between DFD and Flowchart. The flowchart represent flow of
control in program modules. DFDs represent flow of data in the system at various levels. DFD
does not contain any control or branch elements.
DFD Components
DFD can represent Source, destination, storage and flow of data using the following set of
components -

 Entities - Entities are source and destination of information data. Entities are represented
by a rectangles with their respective names.
 Process - Activities and action taken on the data are represented by Circle or Round-edged
rectangles.

31
C Programming BCA-TU [email protected]

 Data Storage - There are two variants of data storage - it can either be represented as a
rectangle with absence of both smaller sides or as an open-sided rectangle with only one
side missing.
 Data Flow - Movement of data is shown by pointed arrows. Data movement is shown from
the base of arrow as its source towards head of the arrow as destination.
Entity-Relationship Model
Entity-Relationship model is a type of database model based on the notion of real world entities
and relationship among them. We can map real world scenario onto ER database model. ER Model
creates a set of entities with their attributes, a set of constraints and relation among them.
ER Model is best used for the conceptual design of database. ER Model can be represented as
follows:

 Entity - An entity in ER Model is a real world being, which has some properties
called attributes. Every attribute is defined by its corresponding set of values,
called domain.
For example, consider a school database. Here, a student is an entity. Student has various
attributes like name, id, age and class etc.

 Relationship - The logical association among entities is called relationship. Relationships


are mapped with entities in various ways. Mapping cardinalities define the number of
associations between two entities.
Mapping cardinalities:

o one to one
o one to many
o many to one
o many to many

Data Dictionary
Data dictionary is the centralized collection of information about data. It stores meaning and
origin of data, its relationship with other data, data format for usage etc. Data dictionary has
rigorous definitions of all names in order to facilitate user and software designers.

32
C Programming BCA-TU [email protected]

Data dictionary is often referenced as meta-data (data about data) repository. It is created along
with DFD (Data Flow Diagram) model of software program and is expected to be updated
whenever DFD is changed or updated.

Pseudo-Code

Pseudocode is an artificial and informal language that helps programmers develop algorithms.
Pseudocode is a "text-based" detail (algorithmic) design tool.

The rules of Pseudocode are reasonably straightforward. All statements showing "dependency"
are to be indented. These include while, do, for, if, switch. Examples below will illustrate this
notion.

Examples:

1. If student's grade is greater than or equal to 60

Print "passed"
Else
Print "failed"

Algorithm

An algorithm is a set of well-defined instructions in sequence to solve a problem. An algorithm


is a set of self-contained sequence of instructions or actions that contains finite space or sequence
and that will give us a result to a specific problem in a finite amount of time.

33
C Programming BCA-TU [email protected]

Qualities of a good algorithm

 Input and output should be defined precisely.


 Each step in the algorithm should be clear and unambiguous.
 Algorithms should be most effective among many different ways to solve a problem.
 An algorithm shouldn't include computer code. Instead, the algorithm should be written
in such a way that it can be used in different programming languages.

Write an algorithm to add two numbers entered by the user.

Step 1: Start

Step 2: Declare variables num1, num2 and sum.

Step 3: Read values num1 and num2.

Step 4: Add num1 and num2 and assign the result to sum.

sum←num1+num2

Step 5: Display sum

Step 6: Stop

Write an algorithm to find the largest among three different numbers entered by the user.

Step 1: Start

Step 2: Declare variables a,b and c.

Step 3: Read variables a,b and c.

Step 4: If a > b

If a > c

Display a is the largest number.

Else

Display c is the largest number.

Else

If b > c

34
C Programming BCA-TU [email protected]

Display b is the largest number.

Else

Display c is the greatest number.

Step 5: Stop

Flowchart

A flowchart is a graphical representation of an algorithm. Programmers often use it as a program-


planning tool to solve a problem. It makes use of symbols which are connected among them to
indicate the flow of information and processing.
The process of drawing a flowchart for an algorithm is known as “flowcharting”.

Definition of Flowchart

A flowchart is the graphical or pictorial representation of an algorithm with the help of different symbols,
shapes, and arrows to demonstrate a process or a program. With algorithms, we can easily understand a
program. The main purpose of using a flowchart is to analyze different methods. Several standard symbols
are applied in a flowchart:

Terminal Box - Start / End

Input / Output

Process / Instruction

Decision

Connector / Arrow

35
C Programming BCA-TU [email protected]

The symbols above represent different parts of a flowchart. The process in a flowchart can be expressed
through boxes and arrows with different sizes and colors. In a flowchart, we can easily highlight certain
elements and the relationships between each part.

Example: Draw a flowchart to input two numbers from the user and display the largest among two numbers

Difference between Algorithm & Flowchart

S.NO ALGORITHM FLOWCHART

Algorithm is step by step procedure Flowchart is a diagram created by different shapes


1. to solve the problem. to show the flow of data.

2. Algorithm is complex to understand. Flowchart is easy to understand.

3. In algorithm plain text are used. In flowchart, symbols/shapes are used.

4. Algorithm is easy to debug. Flowchart it is hard to debug.

36
C Programming BCA-TU [email protected]

5. Algorithm is difficult to construct. Flowchart is simple to construct.

6. Algorithm does not follow any rules. Flowchart follows rules to be constructed.

Algorithm is the pseudo code for the Flowchart is just graphical representation of that
7. program. logic.

37

You might also like