If I have the following code, could a segmentation error ever be caused?
#include <stdio.h>
#include <stdlib.h>
int main() {
int i;
int n = 30;
while(i < n) {
printf("%d ", i);
if(i % 3 == 0) {
n--;
} else {
n = n -2;
}
i = i + 2;
}
return 0;
}
When I ran it, I don't get any segmentation errors but I also don't get any output. And are we always to assume that integer i could be any number in memory? I understand that it will not be initialized to 0, correct?