Hi all,

I have been trying to covert my Factorial of 4 program.c into Cuda Factorial program.But I am unable to do so. Following is my Cprogram(Factorialof4.c).I wrote a cuda program for it(see Attachment)But it gives wrong output.

Tell Me How can I convert this program in Cuda?

Thanks in Advance

```
#include<stdio.h>
int Fact(int *a,int n)
{
int fact,i;
fact =1;
for(i=0;i<n;i++)
{
fact=fact*(i+1);
}
a=&fact;
return(*a);
}
int main()
{
int *a,n,factorial;
n=4;
factorial=Fact(a,n);
printf("Factorial of %d=%d",n,factorial);
return 0;
}
```

Factorialof4.cu (459 Bytes)