We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
C#classResult{//i change this method to void and ref result instead of return as//there is an issue with ascii bla3publicstaticvoidfactorial(intn,refintresult){for(Int32i=n;i>0;i--){result*=i;}}}classSolution{publicstaticvoidMain(string[]args){Int32n=Convert.ToInt32(Console.ReadLine());Int32result=1;Result.factorial(n,refresult);Console.WriteLine(result);}}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Day 9: Recursion 3
You are viewing a single comment's thread. Return to all comments →