factorial (easy)

this is my code

#include

#include<math.h>

using namespace std;
int main()
{
int n,a[n];
int i,j,c;
cout <<pow(5,2);

cin >>n;
for(i=0;i<n;i++)
{
    c=0;
    cin>>a[i];
    for(j=1;j==13;j++)
    {

        if(a[i]/pow(5,j)!=0)

            c=c+(a[i]/pow(5,j));

    }
    cout <<c;
}

}

for the factorial(easy) problem
when i run this program in codeblocks it crashes , but if i remove the initial pow(0 it runs but does not give the proper output(give 0 to everything).alt text

It has these errors.

  1. array declaration. n is not defined.
  2. for loop from j =1 to j = 13 has condition j==13 it will never run.
1 Like

even with return 0;
its the same thing

thank you :slight_smile:

  1. a[n] where n is not defined

  2. j==13 for which loop will not excute…

1 Like
//