Double Factorial problem
how to write the code for this factoriel " F=4(3n+2m)!! +6 " with "goto" comand.
i tried some ways but couldnt do it..errors
Use this basic structure to fix build your code properly
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
#include <iostream>
using namespace std;
int main()
{
int n, fact = 1;
cout<<"enter the number for finding factorial = ";
cin>>n;
a:
if(n>0)
{
fact = fact * n;
n --;
goto a;
}
cout<<"factorial = "<<fact<<endl;
}
|
Last edited on
Topic archived. No new replies allowed.