what is the use of line no.15 in this program i.e
return ans;
what is the meaning of return 0 ???
please explain in hindi
What is the use of line no. 15 in this program?
at line no 15
return ans
this implies we are returning the ans from function
as in the video in factorial function we are returning the ans
now this is taken by those who called this function
for example if we write this
cout<<factorial(5)<<endl;
this means first factorila 5 is calculated and then return value will be printed
meaning of return 0; in main
The return value of the main function is considered the “Exit Status” of the application. On most operating systems returning 0 is a success status like saying “The program worked fine”. In C++ it is optional to type " return 0 ; " at the end of the main function and the compiler includes it automatically.
sorry but explaining completely in hindi is difficult for me
tell me which line is not clear i will explain it again
if you have more doubts regarding this feel free to ask
i hope this helps
if yes hit a like and don’t forgot to mark doubt as resolved