Why is the below program is not coming out of the for loop and the variables outputting dummy values
Code:
/* oddeven.c: Illustrates looping construts */
#include <stdio.h>
int main() {
for (; ;) {
int num;
int evens=0;
int odds=0;
puts("Enter integer: ");
scanf("%d", &num);
switch(num % 2){
case 0:
evens = evens + 1;
break;
case 1:
odds = odds + 1;
break;
}
printf("evens: %d Odds: %d\n", &evens, &odds);
if (evens + odds == 10)
break;
}
return 0;
}
Comment