Every time when the if condition is true the value of count should be printed then become zero. but that's not happening, why?
OUTPUT:
j=99 count=3
j=104 count=104
j=98 count=98. Why the values of j and count are same?
Code:int main() { int j, count=0,p=0, asc[10]={ 99, 104, 98}; for(j=97; j<=122; j++) { count++; if(asc[p]==j) { printf("J=%d\n\n",j); printf("count=%d\n\n",count); count=0; p++; j=0; } } return 0; }