Example C Program for factorial

Example C Program 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…

Read More

C program to find prime number using for loop

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…

Read More