C/C++ Programms

76 Comments

Bubble sort program in C

Here is the program to sort the given integer in ascending order using bubble sort method. Please find the pictorial tutor of the bubble sorting. Logic :  The entered integers are stored in the array A. Here, to sort the data in ascending order, any number is compared with the next numbers for orderliness. i.e. […]

No Comments

To find the sum of the cos series

Here is the program to find the Cosine of the given angle for the user defined accuracy. This is a fast, reliable and robust program, which uses no sophisticated functions but a simple while loop and other math functions. Logic: The program follows the mathematical cosine series, where cosine of the entered radian angle ? […]

6 Comments

Program to find the sum of the sine series

Here is the program to find the Sinusoidal value of the given angle for the user defined accuracy. This is a fast, reliable and robust program, which uses no built in functions but a simple while loop and other math functions. Logic: The program follows the mathematical sine series, where cosine of the entered radian […]

No Comments

To find the sum of digits

Here is the program to find the sum of the digits of the entered number. Main idea in this program is to slice down the given number into digits and to operate on them. Logic : The program asks the user to enter the number, to find out the sum of its digits. Sets the […]

4 Comments

To check whether a given number is palindrome or not

This is the program to check for the ‘Palindrome’ property of the given number. Palindrome is the instinct property of any literal segment, where the segment reads the same either from left to right or vice versa. For example : 12321 and  LEVEL  are the palindromes as they reads same if we go from right […]

3 Comments

To reverse a given number

Here is the program to mathematically reverse the entered integer. The program uses simple library functions, and an easy flow. Logic :  The main idea here is to trace the entered number till its length, and slicing up in each of the iterations. The program asks the user to enter the number to reverse. Sets […]

No Comments

Program for Armstrong numbers

Here is the program to calculate the Armstrong numbers, which will fall within the limit, starting from zero. The program expects the user to enter the upper limit. Definition : Armstrong numbers are the integer numbers , where -the sum of third  power of each digits – equals to the given number itself. Logic :  […]

25 Comments

Program to find the prime numbers between a given range

The program is to find all the prime numbers falls inside the user defined range. A prime number is a one, whose divisors are 1 and the number itself. Logic: This is advanced version of the previous program. Here, user need to enter two numbers as the lower and upper limits for the iteration loop […]

5 Comments

Program to find the prime numbers below a given number.

The program is to find all the prime numbers in the range, which starts from zero and ends at user defined limit. A prime number is a one, whose divisors are 1 and the number itself. Logic: This is a slightly modified version of the previous program. Here, user need to enter the number as […]

3 Comments

Program to find the perfect numbers between a given range

The program is to find all the perfect numbers inside the user defined range. A perfect number is one, whose sum of devisors is equals the number itself. Logic: This is advanced version of the previous program. Here, user need to enter two numbers as the lower and upper limits for the iteration loop to […]