Cod e to find factorial... ignoring any syntax errors (plz tell me if any) is it logically correct?


Code:
#...
#...

int fact(int a);

void main()
{
...
...
...
...
cin >> a;
y = fact(a);
cout << y;
...
...
...
}

int fact(int a)
{ if (a==1)
   return(1);
return  ( a * fact(a-1)
}