Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Write a program to find the Factorial of a number



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

Post New Answer

More C++ General Interview Questions

What is the correct syntax for inheritance a) class aclass : public superclass b) class aclass inherit superclass c) class aclass <-superclass

1 Answers  


Explain terminate() function?

1 Answers  


Which is the best c++ compiler for beginners?

1 Answers  


What is time_t c++?

1 Answers  


What is the difference between static global and global ?

2 Answers   CA,


What are associate containers?

1 Answers  


What is the difference between a template and a macro?

1 Answers  


Can class objects be passed as function arguments?

1 Answers   HCL,


What is singleton class in c++?

1 Answers  


What are register variables?

1 Answers  


What is namespace std; and what is consists of?

1 Answers  


Do you know what is overriding?

1 Answers  


Categories