Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 22nd, 2012  |  syntax: None  |  size: 0.55 KB  |  hits: 12  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Trailing zeroes of Factorial, Runtime error in C?
  2. #include<stdio.h>
  3.  
  4. int main()
  5. {
  6.     long ctr[100000],i;
  7.     float j;
  8.     long d[100000],T,h,o;
  9.  
  10.     scanf("%ld",T);
  11.     printf("n");
  12.  
  13.     for(i=0; i<T; i++)
  14.     {
  15.         scanf("%ld",d[i]);
  16.         printf("n");
  17.  
  18.         for(h=d[i]; h<=0; h--)
  19.         {
  20.             j=h%10;
  21.             if(j==5)
  22.             {
  23.                 ctr[i]++;
  24.             }
  25.         }
  26.     }
  27.     for(o=0; o<=i; o++)
  28.     {
  29.         printf("%ldn",o);
  30.     }
  31.     return 0;
  32. }
  33.        
  34. for(h=d[i]; h<=0; h--)
  35.        
  36. scanf("%ld", &sampleVariable);