Here we will write a program to implement Bubble Sort in C++, first we will learn what is Bubble sort then we will write the C++ code for the same. What is Bubble Sort? Bubble sort, sometimes referred to as sinking sort, is a simple sorting algorithm that repeatedly steps through the list to be […]

## Program to find Perfect Number C++

Here we will write a program to check whether the number is a Perfect number C++. So, first lets start with what is a perfect number. 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: […]

## Program to convert Decimal to Octal in C++

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: OUTPUT:

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