Finding Length of a string in C++

Sometimes we have strings entered by the user and we need to find out the length of a string or size of that length of a string to be used further....

Array Elements summation in C++

Array elements summation is a famous task for programmers, as We can take the array elements from the user also, Similarly we can compute sum of element of array also. Here...

Assignment Operator Overloading in C++

After we do assignment operator overloading, we will then be able to assign two variables of our self-defined datatypes. Lets have a look at the below example: // Operator overloading in C++ //assignment operator overloading #include<iostream> using namespace std;   class Employee { private:     int idNum;     double salary; public:     Employee ( ) {         idNum = 0, salary = 0.0;     }       void setValues (int a, int b);     void operator= (Employee&emp );   };   void Employee::setValues ( int idN , int sal ) {       salary = sal; idNum = idN;   }   void Employee::operator = (Employee&emp)  // Assignment operator function {     salary = emp.salary; }   int main ( ) {       Employee emp1;     emp1.setValues(10,33);     Employee emp2;     emp2 = emp1;        // emp2 is calling object using assignment operator   } Now lets explain this...

Linked Lists with applications in C++

In computer science, linked lists are data structure consisting of a group of nodes which together represent a sequence. Under the simplest form, each node is composed of a data and...

dynamic Array in C++

Dynamic Arrays also Called Array List in C++ are the ones with random size, which can be expanded if needed and contracted if needed. Dynamic Arrays in C++ have the Following...

Address Book program in C++

In C++ we can write an address book program that can store a person’s name and other related data, In this given source code, we are not using any file handling...

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....

McCarthy 91 function in C++

McCarthy 91 function is a recursive function used within computer science, its definition is: Now how we implement this McCarthy 91 function in our C++ code,  have a look at the below...

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...

Writing Factorial program in java

In mathematics, the factorial of any non-negative number let’s say X, is denoted by X! , which is equal to the product of all positive integers less than or equal to...