Explanation: User enters a number, IF number is divisible by 2 i.e. if(number % 2==0), then number is even otherwise odd. Here is the program to find even odd number PROGRAM: #include <iostream> using namespace std; int main() { int number; cout << “Enter any integer: “; cin >> number; if(number % 2 ==0) cout […]

## C++ Program to Check Palindrome Number

Explanation: User enters a number ‘n’. Save that number ‘n’ to ‘old_num’. Find reverse of ‘n’ by taking the remainder ‘num’ and add it to (num*10). Example: if remainder of 151 is 1 we make new number with remainder 1 multiplying it by 10 i.e. 1*10+1=11. And dividing ‘n’ by 10 while (n>0). Finally by […]

## 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 […]

## 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 […]

## C++ program to convert decimal to binary

Hello all, today we are going to write a C++ program to convert decimal to binary number, let’s first discuss how we can convert a decimal number to binary number and later we will write the program for the same. How Program works? Lets take an example of 11. Now divide it by 2 and […]

## C++ program to find HCF and LCM of two numbers

HCF ( Highest Common Factor): The LCM of 2 numbers is Highest common factor of those numbers. For e.g. we have 20 and 30, so HCF will be 10, as 10 is the highest common factor of 20 as well as 30. You must know how to calculate HCF of numbers. LCM ( Lowest […]