New course! Every coder should learn Generative AI!
Try a free lesson0
-c- Return type
what is the point of the usage of reutrun sonuc;?? #include <stdio.h> int fak(int sayi) { int sonuc=1; for(int i=0;i<sayi;i++){ sonuc=sonuc*(i+1); } return sonuc; /// } int main(){ printf("%d",fak(5)); }
2 Answers
0
When you make a call to method with some return type then it must return some data of same type. In your case, the return sonuc just replaces fak(5) by returning a value so that it can be printed.
0
and what is "come back" in your example?
if you already understood what is return value that doesn't mean that everyone must understand it now, right?
I do not understand what is return value also, so I will be happy to get the clear explanation ....