gdsc-ipsacademy / Competitive_Programming

Dive into algorithms, data structures, and competitive programming solutions in hacktoberfest 2023! Don't forget to give a star ;)
MIT License
10 stars 19 forks source link

added factorial in cpp snippet(code template for factorial in cpp). #22

Closed Thejas0604 closed 1 year ago

Thejas0604 commented 1 year ago

Dear Maintainers,

Just added code template for finding factorial in cpp. To check the functionality,

  1. Add these lines above the code snippet.
    #include <iostream>
    using namespace std;
  2. Add this function below the code snippet.
    int main()
    {
    int n = 5;
    cout << "Factorial of " << n << " is " << factorial(n) << endl;
    return 0;
    }

    Verified output: image

Thank you.