On the line that says 'mod = number%iter;', I can replace the modulus with any other operation and it works, but not with modulus. Does anyone know why this is? It just does printf the first two times and then says
RUN FAILED (exit value: 1, total time: 1s)
There will be more code to come, so the function might me useless right now but it won't be in the future. Remember that I'm completely new so please don't over complicate it for my little brain! Here is the code:
#include <stdio.h>
#include <string.h>
int test(int number) {
printf("Number = %d\n",number);
int iter;
int mod;
for (iter=0;iter<number;iter+=1) {
printf("%d ",iter);
printf("%d ",number);
mod = number%iter;
printf("%d\n",mod);
}
return 0;
}
int main(){
printf("C never works\n");
test(10);
}