#Shorts
#clanguage
#Programming
#computerscience
#cprogrammingsolvedexercises
#Algorithm
In this lecturer we will learn how to find factorial of a number using c language.
First of all, What is factorial?
Factorial of a number n is product of all positive integers less than or equal to n. It is denoted as n!.
For example factorial of 5 = 1 * 2 * 3 * 4 * 5 = 120
Algorithm to find factorial of a number:
1. Input a number from user. Store it in some variable say num.
2. Initialize another variable that will store factorial say fact = 1.
(Why initialize fact with 1 not with 0? This is because you need to perform multiplication operation not summation. Multiplying 1 by any number results same, same as summation of 0 and any other number results same.)
3. Run a loop from 1 to num increment 1 in each iteration.
4. Multiply the current loop counter value i.e. i with fact. Which is fact = fact * i.
Visit our website for more Programming Tutorials:
https://myustaadg.com/
Also Visit Other Language Programming Tutorials:
C++ Programming Full Course in Urdu playlist
https://www.youtube.com/playlist?list...
Full Basic C++ practical Exercises playlist
https://www.youtube.com/playlist?list...
To download JDK and Netbeans GUI use link below:
https://drive.google.com/file/d/1YjKr...
.......................Happy Coding ❤.........................