What is the difference between an undeclared variable & an un-initialized variable?
The example I have is
That is the example that I have been given (I have to tell what is wrong with it) and I can see what the problem is, I just am not sure if it's undeclared or uninitialized because I'm not sure of the difference.Code:#include <stdio.h>
main() {
int prime = 21;
for (k = 1; i < prime; k++) {
if (k < prime) {
printf("k is less than prime.\n");
}
}
}
thanks.