Home General

# General

This category lists the general description for the programming.

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

### Simple Java inheritance example

Inheritance is one of the most powerful feature of OOP. It provides us code reusability and polymorphism. The concept is very simple and similar to real life. It allows new classes to...

### Finding Greatest Common Divisor of 2 numbers in C++

As we know that greatest common divisor of 2 numbers is the largest number that divides both those numbers, How we implement this logic in C++, its given in the below...

### Area and Perimeter of rectangle in C++

Area and Perimeter both are the mathematical terms used with rectangle, area is the length multiplied by width while perimeter is the length of all sides of the rectangle. Now how...

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

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

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

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