C Program To Find Factorial of a Number using For Loop
Вставка
- Опубліковано 28 лип 2024
- technotip.com/7496/c-program-t...
Write a C program to find Factorial of a user input number, using for loop.
Example: Factorial of 5 is 120 (1 x 2 x 3 x 4 x 5 = 120).
5! = 120 (It is read as 5 factorial is 120)
C Programming Interview / Viva Q&A List
technotip.com/6378/c-programmi...
C Programming: Beginner To Advance To Expert
technotip.com/6086/c-programmi...
Sir, Thank you for your tutorial💙
Very nice teaching
Thanks for teaching us
you could enter ”count = 2” instead of ”count = 1” into the for() statement to skip the unnecessary first loop. Just something I noticed.
The first loop simply just multiplies 1 with 1 after all.
But if you insert 1 in it then ? Means factorial of one❤
Thank you sir this is very usefull for me
Wow helpful video sir thanks
Solved after 1 hour .thanks
mashallaha bht acha smj aaa jta ha ap ka leacture☺☺☺☺☺☺
Thank you ❤
Ty you saved me👍
It was helpful
What happens when you enter 0?
If i write 4 then how will i get the output like 4*3*2*1=24
4*3*2=4*6=24
it doesnt work for large number , bcuz of size of integer . large number cant be store be integer data type
When I type a no in terminal ..nothing happens.
How do I get it to print out all of the steps until it gets to the answer, for example 1: 1, 2: 2, 3: 6, the factorial of 4 is 24
#include
int main()
{
int num, fact = 1;
printf("Enter a number:
");
scanf_s("%d", &num);
for (int count = 1; count
My code isn’t working
Why do 13 factorial and above become negative using this program?
because here we are using int and we cannot store huge amount of data in int data type
What if i didn't mention, fact= 1... What would it take as default value... ??
Takes a garbage value, means any random number :)
super
Sir op promote us also please in community's post
I did 1k th like 🥳
Thank you for the support. 🙏
❤❤❤
Can any one explian why we use
???
For a new line
Another line
usese the change of paragraph
Is this program work for c++
1 write algorithm
2 Write (n=4 C program size 10 items.
Use neutral language.
Please help me with the video
What's the name of c programming application?
i think it's --> CodeBlocks
Dev c++ brother
codeblocks
🎉
Declaration terminated incorrectly 😄
Tumar program 2 howa nai karon 9,8 number bilakor factorial nulai.only 5,4,3,2 karone he program 2 right
If we find the factorial of 0, then your program displays the factorial 0 but the answer is 1
Factorial of 0 is 1
And placing count from 0
It will drop all other factorials to zero too
I think, or I'm not getting it
ok
Count- - hona chie
It gives wrong answer from factorial of 8
Bcoz it is a long numbers
@@monotheistAli do we hv to take long instead of int ?
@@sania4310 yeah we should use "long int"
@@monotheistAli thx
@@sania4310 did it work tho, I am not working on C much
Sir why assign 1 to fact
Because 0 multiplied by anything is 0
Because if we don't assing an initial value it will take some garbage value as initial value
If we do i=n ; and i-- its possible?
Cause anything multiplied with 0 will be 0
Anything multiple 0 is 0 so if u didn't put 1 then the code will not start it will give result 0 no matter what value u put
Urdu ma batao