#include<stdio.h>
int main()
{
char choice='y';
int num;
while (choice=='y')
{
printf("enter a number\n");
scanf("%d",&num);
printf("%d\n",num*num);
printf("enter your choice");
scanf("%c",&choice);
}
return 0;
}
above code should have keep on looping while choice ='y'.
instead it doesn't promote i/p for choice?
i mean
printf("enter a number\n");
scanf("%d",&num);
printf("%d\n",num*num);
printf("enter your choice");
get executed but it doesn't promote for
scanf("%c",&choice);