C program to print factorial of a number

The below program prints factorial of a number using a loop. The C printf statement is used to output the result on the screen. The factorial of a number can be calculated for positive integers only and is represented by n!. n! = n*(n-1)*(n-2)*……*1 0! = 1 C program to print factorial of a number … Read more

Categories C

C program to check for a Palindrome number

The below program checks for a Palindrome number using a loop. The C printf statement is used to output the result on the screen. A number is called as a Palindrome number if the number remains same even when its digits are reversed. Palindrome Number: abcde = edcba Example: 24142, 1234321, etc. C program to … Read more

Categories C

C program to check prime number

The below program checks if a number is a prime or a composite number. The C printf statement is used to output the result on the screen. C program to check prime number #include <stdio.h>   void main() {   int x,i; int count = 0;   printf("Enter a number:"); scanf("%d",&x);   for (i=1; i<=x; … Read more

Categories C

C program to print fibonacci series

The below program prints a Fibonacci Series without recursion and with recursion. The C printf statement is used to output the result on the screen. A series is called as a Fibonacci series if the each next term of the series is a sum of previous two numbers. C program to print fibonacci series a, … Read more

Categories C