## Example C Program for factorial

What is factorial of a number? Factorial is denoted by the symbol ‘!’. For example, factorial of a number 4 is denoted as 4!. Factorial of a number is defined as the product of “the number and all integers less than that number except zero and negative integers”. Natural numbers ( non-negative integers ) which are greater than zero are used for factorial concept. Factorial Example: Zero factorial (0!) = 1 one factorial (1!) = 1 Two factorial (2!) = 2*1 = 2 Three factorial (3!) = 3*2*1 = 6 Four factorial…

## C program to find prime number using for loop

What is prime number? A number is considered as prime number when it satisfies the below conditions. It should be whole number It should be greated than 1 It should have only 2 factors. They are, 1 and the number itself. Example for prime numbers: 2, 3, 5, 7, 11, 13, 17, 19, 23 etc. Why 4, 6, 8, 9, 10, 12, 14, 15, 16 etc are not prime numbers? Because, the number 4 can be factored as 2*2 and 1*4. As per the rule of prime number, there should be…

## Structure of C Program with Examples

In this post, I am going to explain Basic Structure of C Program for learners. Please remember below commands and syntax to write C program. Commands Description #include <stdio.h> This is a header file. that includes input and output related function int main() This is the main function from where execution of any C program starts. { This indicates the beginning of the main function. /*_some_comments_*/ whatever written inside the command “/*   */” section. won’t be considered for compilation and execution. printf(“Hello World! “); printf command prints the output onto…