Functions in C++

In a C++ programming language a function is a group of statements that together perform a special task. Every C++ program has at least one function, which is main(). In a C++ library has a numerous predefined or built-in functions. For example, strcat() to concatenate two strings, main() from where program execution starts.  In a C++  programming function … Read more

Categories C++

Looping Statements in C++

In a programming often a situation may comes where we want to  execute the set of code again and again. Loop has a ability to repeat set of statement until a condition to be satisfied or a particular number of times. There are following types of  loop in C++  language: In a C++ programming language … Read more

Categories C++

Switch statements in C++

“switch” is a case control structure.  It contains case and default values. “switch” statement takes a value as a expression for equality testing against a list of values/case. syntax for a switch statement:-

Rules of switch statement − In a “switch” statement we can have any number of case. for equality testing against a list of values/case, constant-expression for a case … Read more

Categories C++

Decision Making Statement in C++

In the C++ language decision making statement executes if the given condition is  true otherwise conditional block will never execute. C++ language assumes non-zero and non-null values as true, and zero or null is assumed as false value. There are following types of decision making statements in C++ programming language. if statement Syntax of an ‘if’ statement − if(Condition) { /* statement will execute … Read more

Categories C++

Operators in C++

An operator is a symbol. It is used to tells the compiler to perform specific mathematical or logical functions. C++ language have a following types of built-in operators:− Arithmetic Operators Relational Operators Logical Operators Bitwise Operators Assignment Operators   Arithmetic Operators C++ language have a following arithmetic operators. Assume variable i holds 100 and variable j holds 200 then … Read more

Categories C++

Basics of C++

Tokens in C++ In a C++ language, token is either a keyword, a symbol ,an identifier, a constant or a string literal. A C++ program consists of various tokens for example, the following C++ program consists of four tokens

The individual tokens are −

Comments Comments are the text in C++  program language … Read more

Categories C++

Variables in C++

Variables is a name given to memory location.              int x =10;                     here, x is a integer variable.                                                     Integer variable x is a name given to memory location and where we stored integer value10. Initialize variable we can also initialize variables as below. int  a,b,c; a=10;b=20;c=30; Here, we have initialized three integer variable a,b & … Read more

Categories C++

Data Type in C++

There are four types of data type in C language.  They are as follows: Types Data Types Basic data types int, char, float, double, boolean User Defined data type structure, union, enum Derived data type Pointer, array, function Basic Data Types In C Language Integer Data Type Integer data ( example 1,2,3,4,5,6, ….. etc. ) … Read more

Categories C++

Simple Program in C++

A simple C++ program basically consists of the following parts − Preprocessor Commands Functions Variables Statements & Expressions Comments Basic structure of C++ program

Above shown the basic structure of C++ program. For every program we have to writeabove mention basic structure. How to write or print We can write or print in C++ … Read more

Categories C++

Introduction of C++

C++ was developed by Bjarne Stroustrup in 1979. C++ is both procedural  and object oriented programming language. C++ is a programming language that contains the feature of C programming language as well as includes a concept of object Oriented language. C++ programming  introduced the concept of Class and Objects. C++  is a  high-level language which can … Read more

Categories C++