+ 1

Can anybody help with this code because it's not given no output

Factorial code I have made some changes but output is given "no output" please anybody help me in this.....

20th Mar 2019, 4:54 AM
Anil Gupta
Anil Gupta - avatar
7 odpowiedzi
+ 5
So here is your code: https://code.sololearn.com/cVHeZQq2lmEc/?ref=app The problem is that you forgot to use & (Address Operator) in the scanf() function Change line no. 9 to this: scanf("%d", &x); And your code will be fine! Note that using & Operator is must while scanning value from user in C Language, otherwise that value will freely move in the memory and will not be stored in the proper variable.
20th Mar 2019, 5:01 AM
Letsintegreat
Letsintegreat - avatar
+ 4
Anil Gupta No you have not used address operator. Check this: scanf(" %d", *x*); Change *x* to *&x*
20th Mar 2019, 5:13 AM
Letsintegreat
Letsintegreat - avatar
+ 4
Anil Gupta Check mark my main answer if that helped you
20th Mar 2019, 5:29 AM
Letsintegreat
Letsintegreat - avatar
+ 2
Show us your code. We can’t help you if we can’t see what youve done
20th Mar 2019, 4:58 AM
Nathan Lewis
Nathan Lewis - avatar
20th Mar 2019, 5:10 AM
Anil Gupta
Anil Gupta - avatar
+ 1
But I have already address operator in scanf but still given same output that "no output "
20th Mar 2019, 5:12 AM
Anil Gupta
Anil Gupta - avatar
+ 1
Absolutely right I have forgotten to add that thank you so much
20th Mar 2019, 5:16 AM
Anil Gupta
Anil Gupta - avatar