actually I am facing a problem in creating a program. I have recently started learning c, and in the code
main()
{
      char another;
      int num;
      do
      {
        printf("enter a number");
        scan("%d", & num);
        printf("want to enter another no. y/n");
        scanf("%c", &another);
       }while(another=='y');
}
the program ends without accepting the value of y or n
I changed the %c to %d, then it accepted the ASCII values of y and n(121 and 110), instead of the letters.
please help me solve this problem