The i variable is causing my program to crash and it'll work without it but I'm not understanding why and if I replace with any other number it'll work but not do what I'd like.
void longest_prime_factor(int n){
for (int i=0;i<n;i++){
if (n % i == 0) printf("true\n");
}
}
longest_prime_factor(17);
Output
0 [main] primefactors 238 cygwin_exception::open_stackdumpfile: Dumping stack trace to primefactors.exe.stackdump