Write a program to find the Factorial of a number
Answer / Raghvendra Kumar
```cppn#include <iostream>nnint factorial(int n) {n if (n == 0 || n == 1) return 1;n return n * factorial(n - 1);n}nnint main() {n int num;n std::cout << "Enter a number: ";n std::cin >> num;n std::cout << "Factorial of " num "":n std::cout << factorial(num) << std::endl;n return 0;n}n```
| Is This Answer Correct ? | 0 Yes | 0 No |
How would you stop a class from class from being derived or inherited?The constructer should not be Private,as object instantiation should be allowed.
What is the difference between a definition and a declaration?
What do you mean by C++ access specifiers ?
Explain the difference between using macro and inline functions?
What does n mean in c++?
why c++ is not called strictly d super set of c?
without if else statement can be written ah
What does scope resolution operator do?
How does the copy constructor differ from the assignment operator (=)?
What is the difference between equal to (==) and assignment operator (=)?
class base { public: int fun(int) {} }; class base2 { public: int fun(float) { } }; so here qustion is both function either function overloading or over riding;
Explain "const" reference arguments in function?