Why while loop is exiting without asking for the value of another, even in the for loop the value of another is not being set .
#include<stdio.h>
int main(){
char another ='y';
int num = 0;
int i =0;
/*for(;another =='y'||another =='Y';i++){
scanf("%d",&num);
printf("%d",num);
printf("Enter another num?");
scanf("%c",&another);
}*/
while(another == 'y'|| another == 'Y'){
scanf("%d",&num);
printf("%d",num);
if(another == 'y'||another =='Y')
scanf("%c",&another);
}
return 1;
}