Close
Close

factorial in c++

   sahebalam , sagi rama krishna college

Write c++ program to find factorial of a number?


Answers

  •   

    include <iostream>

    using namespace std;

    int main()

    {

    int num;

    cin » num;

    int fact=1;

    while(num>0)

    {

    fact*=num;

    num--;

    }

    cout « fact « endl;

    return 0;

    }


    • thanks
      - sahebalam
    • thanks
      - sahebalam

Ask Yours
Post Yours
Write your answer