Sunday 2 March 2014

History of C++

In 1967, BCPL language was developed by Martin Richards. The BCPL Language was used to write operating system and compilers. After two years, Ken Thomson developed B programming language programming language had advanced features as compared with BCPL. The UNIX operating system was first developed in B in 1970at Bell Laboratory. Both BCPL and B were "type-less" language. Thus each data item in these languages occupied one "word" in the memory.

            In 1972, Dennis Ritche developed C language at Bell laboratory. The C language was advanced version of B language. It had many important concepts of BCPL and B languages. New features like data typing and many other functions were also included in c language. The nest version of UNIX is revised and written in C. c language was developed as computer independent language. A program written in C can be run on any computer.

            In 1980, C++ was developed by Bjarne Stroustrup. It was an extension of C. It was designed for UNIX system environment. C++ enabled programmer to improve quality of code. It included object oriented programming.

What is a program?

An ordered list of events to take place or procedures to be followed; a schedule. A collection of instructions that tell the computer to do specific activity. A program is generally known as "software". The terms software, application, program and instruction are synonymous in the sense that they all tell the computer to do some specific activity. A program is written in a programming language, such as C or C++. The program contains machine instructions, buffers, constants and counters.

Algorithm

Algorithm

           A step-by-step problem-solving procedure, especially an established, computational procedure for solving a problem in a finite number of steps. A set of ordered steps for solving a problem, such as a mathematical formula or the instructions in a program. Algorithm and logic are synonymous. Both refer to a sequence of steps to solve a problem.

Saturday 1 March 2014

Data Types

Data types in C++:



                The variable type specifies the type of data that can be stored in it. Each variable  is declared by its  type.
C++ has five basic data type. These are
int                          Integer
float                       Floating point
double                   Double precision
char                       Characters
bool                       Boolean

First five data type are also available in C language. The bool is data type a new addition in C++.

The int data type:
                                  This data type is used to declare integer data type variable. An integer is whole number .the storage capacity of int type variable can be changed by applying the   integer qualifiers. There are three qualifiers that can be applied to int data type variables. These are
Short int(storage capacity  is 2 byte)
Long int (storage capacity is 4 byte)
Unsigned int(storage capacity is 2 byte and store only positive whole number)

Float data type:
                                       Float represents real or floating type data. The real data type is represented in decimal or exponential notation it may be signed or unsigned and its storage capacity is 4 byte.

Char data type:
                                      The char stands for character. It is used to declare character type variable. In character type variable, alphabetic characters, numeric digits and special charters can be stored.

Bool data type:
                         The word bool stand for Boolean. It is used to declare logical type variables. In logical type variable only two values true or false can be stored. True is equivalent to 1 and false to 0.



Data Types Characteristics