Just testing some code; the following is supposed to run until I enter 'n'. But it stops after one round. Can anyone explain it, and help me implement what I want?
#include <stdio.h>
int main ()
{
  char another = 'y';
  int num;
  while ( another == 'y' )
    {
        printf ("Enter an number ");
        scanf ("%d", &num);
        printf ("square of %d is %d", num, num * num);         
        printf ("\nWant to enter another number y/n\n");
        scanf ("%c", &another);
    }
}
Thanks.
I really appreciate every one's comments. I did search online for GDB, and used it later. I have to say it made identifying the issue so much easier. Thanks so much.
 
     
    