I was solving a programming problem in C language, came across in a book
the code was as following :-
#include<stdio.h>
#include<conio.h>
void main()
{
int num;
char another;
do
{
printf("Enter a Number");
scanf("%d",&num);
printf("Square Of The Entered Number Is = %d",num*num);
printf("Do You Still Want To continue (y/n)");
scanf("%c",&another);
}while(another=='y');
getch();
}
Now when i ran this programme in "TurboC++ MSDOSBox for Windows 7"
programme exits even if I enter "y" after following statement "Do You Still Want To Continue(y/n)"
Looks Like it is not executing any statement after this one
scanf("%c",&another);
because i have added another statement after this one as :-
scanf("%c",&another);
printf("another is = %c",another);
but the value of another never got printed. the programme exits directly