Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Question!


Name: Mohammad
Title:
  what is the problem?
Question:
#include <iostream>
using namespace std;
long int fact(int n);
{
   long int f=1;
    if (n<0)
    return 0;
    while (n>1)
    {
        f*=n--;
    }
    return f;
}
int main()
{
    float a;
    int r, sum1=0 , p , k , f1 , f2 , sum2=0 , j;
    while (1)
    {
        cin >> a;
        if (a<=0)
        { break;
        else
        p=(int) a;
        k= a-p;
        while(p>0)
        {
            r=p;
            f1=fact(int r);
            sum1=sum1 f1;
        }
        while(k>0)
        {
            j=(int)(k*10);
            sum2=sum2   j;
            k=(k*10)/10;
        }
        f2=fact(int sum2)
        }
        cout << "majmoe factoriyelhaye ghesmate sahihe adad=" << sum1 << endl;
        cout << "majmoe factoriyelhaye ghesmate ashare adad=" << f2 << endl;
    }
    return 0;
}
Answers:

Name: oscar
esto es facil