Pointers in C++

Pointers in C++ are the variables that contain memory addresses as their values. Normally, a variable directly contains a specific value. A pointer contains the memory address of a variable that,...

Comparing two Numbers in C++

Here we are going to look at an example which is able of comparing two numbers in C++. In future we might need a simple code for comparing two integers to...

Program for Palindrome in C++

Palindrome is a word that reads the same forward or backward. Now how can we check a string that it is a palindrome or not? We can do it by using...

Hello World in C++

The Hello world program is a simple computer program that prints (or displays) the string "Hello, world!" or some variant thereof. It is typically one of the simplest programs possible...

Generation of Prime Numbers in C++

Implementing the 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. Lets...

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

datatypes in C++

Just like other languages, all variables have a datatypes in C++  ,name, size and value. The detailed info of the datatypes of C++ is: Type Name Bytes Other Names Range of...

Generate Random Numbers in C++

We generate random numbers in C++ because it is used mostly in games and other automatic stuff. To Generate random numbers  we need some ready  made libraries, we use the library...

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

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