Here we will write a program to convert Decimal to Octal in C++ programming language. First lets start with how to convert decimal to octal: Here is an example of using repeated division to convert 1792 decimal to octal: Decimal Number Operation Quotient Remainder Octal Result 1792 ÷ 8 = 224 0 0 224 ÷ […]

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

## C++ Program to Find Even Odd number

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