Introduction to Computer Programming using C++

Introduction to Computer Program:

A computer program is a set of instructions written in computer language to perform a specified task. A computer program tells the computer that what to do and in which order to do. 

We know that a computer is a machine. It can’t perform any task without user’s instructions. The users use computer language to instruct the computer. Thus the set of instructions, given to computer by a user using some computer language forms a computer program.  

What is Programming & Who are Programmer?

The process of writing computer programs using computer language is called programming. Computer programming, also known as coding. 

Introduction to computer progarmming using C++

A programmer is a technical person that writes computer programs by using computer programming languages. A programmer writes, tests, debug and maintain computer programs. A programmer is also called coder. 

Meaning of IDE in Programming:

IDE is a software application that provides comprehensive facilities to computer programmers for software development. An IDE normally consists of a source code editor, debugger and executing the tool. 

IDE is used to write computer programs using computer languages for software development. 
Some popular IDE’s for C++ programming language are: Dev C++, Turbo C++, Falcon C++.      

What is High-Level Programming Language?

Simply, a programming language is A set of words, symbols, and codes used to write a computer program. Simply we can say that a computer language that is used to write computer programs to instruct the computer is called programming language. C++ is an example of programming language.

A High-Level language is a programming language designed to simplify computer programming. This programming language is close to natural language (human language). Thus high-level languages are easy to understand. The instruction of these languages is written in English-like words. 
C++ is an example of High-Level language.

Introduction to C++ Programming Language:

C++ ("pronounced as cee plus plus") is a high-level computer programming language. It was developed by Bjarne Stroustrup, at Bell Lab. In 1980. It is an improved/ enhanced version of C language. It is a very powerful language and is used to develop a variety of software.  

Why the language C++ is named so?  

Before C++ there was a language known as C language. ++ (plus plus) is an operator in C language. In C language, ++ can, depending on context, be read as "next," "successor," “increment” or “enhancement”, though it is always pronounced "plus"

Thus ++ refers to enhancement. Now the C++ is named so because it is an enhancement to "C" programming language. So C++ takes its name from the C operator command ++, meaning changing in value. 

What are the Reserved words in C++?

Reserved words are also called keywords. In a programming language, a reserved word is a word that has a predefined meaning and purpose. The meaning and purpose of a reserved word are defined by the developer of the language. 

It can’t be changed or redefined by the user. A reserved word can be used for the same purpose for which it is defined.  The reserved words must be written in lower case.

Here are a few lists of C++ reserved/ keywords, they are:
Int, long,  inline, goto, break, case, catch, char, class, const, constant_cast, continue, default, delete, do, double, else.

Header File in C++:

A header file is also called “include file”. A header file is a file that contains the definition of different predefined functions and objects/terms. Header files contain definitions of Functions and Variables. The meaning and purpose of different predefined functions and objects are stored in header files. Header file has an extension "h". 

Variable and Rule for naming Variable in C++:

A variable in C++ is a name for a piece of memory that can be used to store information. A variable is the name of a memory location where a value can be put/stored and retrieved.

A variable is a name for a memory area. A variable is thus used to store data. When a variable is declared a piece of memory is allocated to it.

Following are some rules naming variables in C++:

 Variable may include a character, sequence of characters, numbers and underscore _.  Example: a, ab, sum, my_name, number1.

 The first character of a variable must be a letter (alphabet) or underscore _. A variable name should not start with a digit.  Example: a, sum, _result, a1, number1 ->valid      1a, 1number -> invalid 

 Special symbol except underscore _ can’t be used with a variable name.  
Example: my_name -> valid      
my#name, a@, sum*, my$name -> invalid 

 White spaces are not allowed in the variable name. 
Example:  myname -> valid,
myname -> invalid  

 Reserved words can’t be used as a variable name.  
Example: if, do, for -> these words can’t be used as a variable name as these are reserved words. 

A variable name should be meaningful and should not be too long.

Post a Comment