spoj.pl/problems/FCTRL2/
its a simple factorial problem and i dont see whats the error in my code..but i get wrong answer everytime i try....even for a few other problems i got such errors...till now only the first problem has actually worked for me....any idea where im going wrong?
#include<iostream>
#include<stdio.h>
using namespace std;
int factorial(int m)
{
return (m==1?1:m*factorial(m-1));
}
int main()
{
int t,m;
scanf("%d",&t);
while(t--)
{
scanf("%d",&m);
printf("%d\n",factorial(m));
}
return 0;
}