We all know that computer is an electronic device that takes data as input, processes it and gives meaningful result as output. A computer processes data on the basis of instructions. These instructions direct computer hardware (i.e. CPU) to perform various operations, like arithmetic operations, logical operations, memory allocation etc.
The set of instruction given to a computer is called a program or computer program. These computer programs are written in programming languages which are also known as High Level Languages (HLL). High Level Languages are near to human language and can be converted into languages understandable by computer hardware ( machine code and binary numbers). Thus, a programming language acts as a interpreter between humans and computers.
We have different programming languages to communicate with computers like, C, C++, java, python etc.
In this course, we are going to learn C++.
C++ is one of the most popular and powerful general purpose language came into existence in 1979, and was developed by Bjarne Stroustrup at AT&T bell labs. Although, its first edition was launched in 1985 . It was initially developed as an extension C language, but later became much popular.
C++ can be used to develop operating systems, browsers, games, and so on. C++ supports different ways of programming like procedural, object-oriented, functional, and so on. This makes C++ powerful as well as flexible.
Basically, for programming a programmer needs two things a text editor to write programs and an interface to convert them in machine code. This interface is called compiler. A compiler itself is a program that converts high level language into machine understandable language.
An Integrated Development Environment (IDE) is a software that comes with both, the text editor and compiler and also with other necessary tools for programming, software development and testing.
There various IDE based on different compilers. But in this course we will use Code::Blocks IDE based on GNU Compiler Collection (GCC).
To download Code::Block go to the following link,
http://www.codeblocks.org/downloads/26it is available for linux and windows
Mac OS users have to download Xcode IDE based on Clang compiler
To download you may go to Apple website or Apple Appstore .
‘Hello world!’ is the first program one writes while learning a programming language. We will do the same in C++ language.
//my first program #include<iostream> using namespace std; int main(){ cout<<"Hello world !"; return 0; }
Output:
Hello world!
Let’s see how this works.