Category Archives: Loops

Convert Decimal Number to Roman Numeral in C and C++

Here you will get program to convert decimal number to roman numeral in C and C++. How it Works? Divide the given number in the order 1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1 to find largest base value. Display the corresponding roman symbol of largest base value obtained by above… Read More »

Perfect Number in C

Here you will get program for perfect number in C. Perfect number is a positive number which is equal to the sum of all its divisors excluding itself. For example: 28 is a perfect number as 1 + 2 + 4 + 7 + 14 = 28. 15 is not perfect number as 1 +… Read More »

Strong Number in C

Here you will get program for strong number in C. What is Strong Number? A number in which the sum of factorial of individual digits is equal to the number is called strong number. For example, 145 is a strong number because 145=(!1)+(!4)+(!5)=1+24+120=145 The below C program will check whether a given number in strong… Read More »

C/C++ Program to Remove Spaces From String

For example given string is “the crazy programmer”. Now we have to remove all the spaces present in the string.   Before: the crazy programmer After: thecrazyprogrammer Below I have shared a program that perform above task with simple approach. You can ask your queries in the comment section. C/C++ Program to Remove Spaces From… Read More »

C/C++ Program for Fibonacci Series Using Recursion

Series 0, 1, 1, 2, 3, 5, 8, 13, 21 . . . . . . . is a Fibonacci series. In Fibonacci series, each term is the sum of the two preceding terms.   The C and C++ program for Fibonacci series using recursion is given below.   C Program

C++ Program

  Output:

Program for Fibonacci Series in Java

Here you will get program for fibonacci series in Java. It is a series in which next term is obtained by adding previous two terms. A fibonacci series will look like 0 1 1 2 3 5 8 13 21 34 . . . . Program for Fibonacci Series in Java

  Output How many… Read More »