Business Application Programming
Business Application Programming
Introduction:
C is a general-purpose programming language that is extremely popular, simple
and flexible. It is machine-independent, structured programming language which is used
extensively in various applications.
C was the basic language to write everything from operating systems (Windows and
many others) to complex programs like the Oracle database, Git, Python interpreter and
more.
It is said that 'C' is a god's programming language. One can say, C is a base for the
programming. If you know 'C,' you can easily grasp the knowledge of the other
programming languages that uses the concept of 'C'
It is essential to have a background in computer memory mechanisms because it is an
important aspect when dealing with the C programming language.
History of C language
1. 1960 - ALGOL - Developed by International Group
2. 1967 - BCPL - Developed by Martin Richards
3. 1970 - B - Developed by Ken Thompson
4. 1972 - C - Developed by Dennis M. Ritchie
5. 1978 - K&R C - Developed by Brian w. Kernighan and Dennis M. Ritchie
6. 1989 - ANSI C - Developed by ANSI Committee
7. 1990 - ANSI/ISO C - Standardaized by ISO
Languages such as C++/Java are developed from 'C'. These languages are widely used
in various technologies. Thus, 'C' forms a base for many other languages that are
currently in use.
The C programming language is developed by Dennis Ritchie at AT&T Bell
Laboratories in 1972. It is named C because many features of C were derived from an
earlier language called B.
The history of C language goes back to 1960’s, when a number of computer
languages were being used for various purposes. COBOL (Common Business-Oriented
Language) was being used for commercial purposes, FORTRAN (Formula Translation)
was being used for scientific and engineering applications and so on.
Most of the modern languages including ANSI (American National Standards
Institute)/ISO (International Organization for Standardization) C are derived from the
algorithmic language called ALGOL which was developed by international group and
introduced in 1960’s.
Martin Richards in 1967 developed programming language called BCPL (Basic
Combined Programming Language) which was derived from ALGOL. Similarly,
BCPL influenced development of programming language called B by Ken
Thompson in 1970.
In 1972, Dennis Ritchie introduced “Traditional C” and it was confined to use
within Bell Laboratories until 1978.
In 1978, Brian Kernighan and Dennis Ritchie published a book called “The C
Programming Language”. The book was so popular and the use of C started spreading. C
Language at that time is commonly referred to as “K&R C”.
In 1983, the American National Standards Institute formed a committee to produce a
C programming language standard. This “ANSI C” was completed in 1988, and was
approved in 1989. It was then approved by the International Organization for
Standardization (ISO) in 1990.
Importance of C Programming
C programming language has following importances:
1. C is robust language and has rich set of built-in functions, data types and
operators which can be used to write any complex program.
2. Program written in C are efficient due to availability of several data types and
operators.
3. C has the capabilities of an assembly language (low level features) with the feature
of high level language so it is well suited for writing both system software and
application software.
4. C is highly portable language i.e. code written in one machine can be moved to
other which is very important and powerful feature.
5. C supports low level features like bit level programming and direct access to
memory using pointer which is very useful for managing resource efficiently.
6. C has high level constructs and it is more user friendly as its syntaxes approaches
to English like language.
Link Section
The link section consists of the header files of the functions that are used in the program.
It provides instructions to the compiler to link functions from the system library.
Definition Section
All the symbolic constants are written in definition section. Macros are known as
symbolic constants.
Subprogram Section
The subprogram section contains all the user defined functions that are used to perform a
specific task. These user defined functions are called in the main() function.
Advantages of OOP
Re-usability:
“Write once and use it multiple times” you can achieve this by using class.
Redundancy:
Inheritance is the good feature for data redundancy. If you need a same functionality in
multiple class you can write a common class for the same functionality and inherit that
class to sub class.
Easy Maintenance:
It is easy to maintain and modify existing code as new objects can be created with small
differences to existing ones.
Security:
Using data hiding and abstraction only necessary data will be provided thus maintains the
security of data.
Disadvantages of OOP
Size:
Object Oriented Programs are much larger than other programs.
Effort:
Object Oriented Programs require a lot of work to create.
Speed:
Object Oriented Programs are slower than other programs, because of their size.
Advantages of OOP
1. Re-usability
2. Data Redundancy
3. Code Maintenance
4. Security
5. Design Benefits
6. Better productivity
7. Easy troubleshooting
8. Polymorphism Flexibility
9. Problems solving
Benefits of OOP
Syntax:
#include<iostream.h>
int main()
{
.........;
return 0;
}
Example:
#include<iostream.h>
//main() is where program execution begins.
int main()
{
cout << "This is my first C++ Program!";
return 0;
}
Output:
Command Prompt
1. The C++ language defines several headers, which contain information that is
either necessary or useful to your program. For this
program, #include<iostream.h> header is needed. this header file is included for
Standard I/O (input output) function.
2. The next line //main() is where program execution begins. is a single-line
comment available in C++. Single-line comments begin with // and stop at the end
of the line.
3. The line int main() is the main function where program execution begins.
4. The next line cout << "This is my first C++ program!"; causes the message
"This is my first C++ program" to be displayed on the screen.
5. The next line return 0; terminates main() function and causes it to return the value
0 to the calling process.
Applications of C++