I used the tutorial method for small factorial and every test case I’ve tried matches the calculator answer but codechef is still giving me ‘Wrong Answer’. Can someone please tell me what to fix? Is it the format of the output that’s wrong?
Whats wrong in this code?
printf(“enter the test cases\n”);
printf(“enter all numbers\n”);
printf("\nfact for %d is: %d",a[i],fact);
There is very minor error in your code , your logic is alright .
you forgot to insert the newline character after printing 1 .
intead of printf ("%d",1);