Tricky Questions or puzzles in C Part 3
Thank You for the amazing response to the previous two posts on Tricky questions on C. In this post, we will again see some of the nice and interesting questions often asked in the interviews. 1) How to calculate the Factorial of the number without using Recursion and Loop? Calculating factorial is very simple using recursion or loop, but how to calculate factorial without using anything? Using the sterling´s approximation for the factorial , which is given by the formula n! = sqrt(2*pi*n)*pow((n/e),n) Please note that this formula will not give the exact value of the factorial because it is just the approximation of the factorial. I understand that it is not a "Tricky" question but it depends on the knowledge of the person about this formula, so if somebody has seen the formula then only he can answer the question. This is the rough code for calculating the above (may not work with large numbers) int main { int a; float e,y,x,z; scanf("%d...