#include<stdio.h>
int main()
{
int num;
char another;
do
{
printf(“enter the number”);
scanf("%d", &num);
printf(“the square is %d” ,num*num);
printf(“want another y/n”);
scanf("%c",another);
}while(another=='y');
return 0;
}
#include<stdio.h>
int main()
{
int num;
char another;
do
{
printf(“enter the number”);
scanf("%d", &num);
printf(“the square is %d” ,num*num);
printf(“want another y/n”);
scanf("%c",another);
}while(another=='y');
return 0;
}
there is error in your code →
scanf("%c",another);
your missing " & " and also " \n "
scanf("\n%c",&another);
The reason should be one of these
('\n')
character.('\n')
character.('\n')
character.ok i tried \n still not working
Paste the modified version of your code.