#include <stdio.h>
int main() {
int niz[100], i, j, k, l;
j = 0; // k=l=0;
printf("Unesite niz (-1 for end)");
do {
scanf("%d", &niz[i]);
if (niz[i] % 5 == 0)
j++;
// if(niz[i]%7==0) k++;
// if(niz[i]%11==0) l++;
} while (niz[i] != -1);
printf("Broj djeljivih sa 5 je:%d", j);
// printf("Broj djeljivih sa 7 je:%d",k);
// printf("Broj djeljivih sa 11 je:%d",l);
return (0);
}
What's problem with this code, it works fine with comments but when I uncheck comments it gives me a crash. The problem I have is to solve how much numbers are possible to divide by 5,7 and 11.