Perfect Number Program in C++

What is a Perfect number: Perfect Number is a number in which sum of all its positive divisors excluding that number is equals to the number. For example:     6 Sum of divisors = 1+2+3 = 6 Here we will find perfect numbers between 1 and 500. Program explanation: 1. Take first number as … Read more

Program to Solve Quadratic equation C++

Here we will a write a program to solve quadratic equation C++ programming language. Let’s first understand how to solve a quadratic equation: Let’s take the quadratic equation as: ax²+bx+c=0 How program works: Take the values for a, b and c (double type). if, a = b = 0 then invalid equation if b² -4ac < … Read more

Program to Print Fibonacci Series in C++

What is Fibonacci Series? In mathematics, the Fibonacci numbers or Fibonacci sequence are the numbers in the following integer sequence: or (often, in modern usage): (sequence A000045 in OEIS). By definition, the first two numbers in the Fibonacci sequence are either 1 and 1, or 0 and 1, depending on the chosen starting point of … Read more

Write a C++ program to Make Calculator

Here is the Simple C++ Program to make Calculator PROGRAM: #include <cstdio> #include <cstdlib> #include <iostream> using namespace std; int main(int nNumberofArgs, char* pszArgs[]) { // enter operand1 op operand2 int nOperand1; int nOperand2; char cOperator; cout << "Enter 'value1 op value2'n" << "where op is +, -, *, / or %:" << endl; cin … Read more

C++ Program to check Prime number

Today we are going to write a C++ program to check if a number is a Prime number i.e. if a number enter by user is a prime number or not. We all know what a Prime number is let’s recall quickly: Prime Number: A number which is divisible by 1 and itself is called … Read more

C++ Program to swap two numbers without using temporary variable

Today we are going to write a C++ program to swap two numbers without using  any temporary variable, let’s start. There are many ways to swap two numbers without using a Temporary variable. Here I’ve discussed two methods: Using ‘+’ and ‘-‘ operators. Using Bitwise XOR ‘^’. There is another way to swap using call … Read more