A Simple Calculator in C++

If we want to create a simple calculator in C++ which is able to operate simple arithmetic operations  like addition, subtraction, multiplication and division. again here is an example of applications...

Overloading Addition operator in C++

Here we have overloaded addition operator for a specific class or one can say addition operator is overloaded for a self-defined data type in C++. The code is: ...

Control structures in C++

Control structures in C++ also called the decision makers. In C++ We have control structures which are helpful in programs which needs a little bit concept of decision making between different...

Fibonacci Number program in C++ using Recursion

This program shows A Fibonacci Sequence starting from a user's entered number, the approach used here is recursive.Have a look at the code: //febonacci using recursion ...

Converting lowercase to uppercase in C++

Here we are converting lowercase to uppercase in C++ by using an additional library in our includes;Here is a code which is able of converting a string from lowercase to uppercase: // converting lowercase to uppercase in C++ #include <iostream> #include <cctype> using namespace std; void convertToUppercase( char * );   int main() {     char phrase = "characters and $32.98";     cout << "The phrase before conversion is: " << phrase;     convertToUppercase( phrase );     cout << "nThe phrase after conversion is:  "         << phrase << endl;     return 0;  // indicates successful termination }   // convert string to uppercase letters void convertToUppercase( char *sPtr ) {     while ( *sPtr != '' ) {   // current character is not ''         if ( islower( *sPtr ) )  // if character is lowercase,             *sPtr = toupper( *sPtr );  // convert to uppercase         ++sPtr;  // move sPtr to next character in string     } } in...

Generating Prime Numbers in C++

Now implementing this logic of Prime Numbers into our c++ code, we need simple for loops and conditional statements. This is very easy to implement and print Prime Numbers upto 1000....

Recursive factorial function in C++

Here we are going to define our recursive factorial function in C++: #include <iostream> using namespace std; int factorial(int n) // 1, 1, 2, 6,...

Performing Operator Overloading in C++ with example

As we know The variables of primitive data types can perform a number of different operations (functions) using operators like (+, - , /, *)/ For Example: a + b * c...

Classes with applications in C++

Classes are defined by using the keyword “ class ”  and have a body closed in braces {}  just like structures and ends with a semicolon( ; ). We cannot initialize...

Overloading steam insertion and extraction operators in C++

For putting data into the stream and getting data from the stream, the stream insertion and extraction operators are used, Now these operators are already defined for defined datatypes in C++,...