I wrote this table writing program in which I wanted to give program ability to continue depending upon char input value but after taking input, Even if input is y the loop still doesnt execute and program moves towards next line
#include <stdio.h>
#include <conio.h>
int main()
{
int T, N, P;
int K = 1;
char ch;
do
{
printf ("\nWhich Number's Table do you want?");
scanf ("%d", &T);
printf ("\nTable should be Uptil?");
scanf ("%d", &N);
do
{
P= T * K;
printf("\n %dx%d = %d", T, K, P);
K= K + 1;
} while(K <= N);
printf("\nDo you want to continue (Y/N)?");
scanf("%c ", &ch);
} while (ch == 'y');
getch();
}