pointers
Discuss pointers in C.
... and anything else that folks are interested in.
can you find the bug?
# include <stdio.h>
# include <stdlib.h>
# include <math.h>
int modarithmeticone(int i, int x){
int one=1, n;
float negativeone = -1.0;
x = i * (int) pow(negativeone, (double)(i + one)) % n;
return x;
}
int main(){
int a=4, i, x, n=9;
for (i = 1; i <= a; i++){
/*if (dividenumbminusone(n, 1, 2, a)!=0){*/
if (modarithmeticone(i, x)){
printf("x = %i n = %i a = %i i = %i \n", x,n,a,i);
}
}
return 0;
}