#include<stdio.h>
#include"string.h"
int IsPerfectSquare(char n[50]);
main()
{
char n[50];
clrscr();
while(1)
{
printf("Would you like to play again?/n");
scanf("%s",&n);
if(IsPerfectSquare(n)==1)break;
if(IsPerfectSquare(n)==0)
{
printf("play game again./n");
}
if(IsPerfectSquare(n)==2)
{
printf("please answer yes or no./n");
}
}
getch();
}
int IsPerfectSquare(char n[50])
{
if(strcmp("yes",n)==0)
return 0;
if(strcmp("no",n)==0)
return 1;
return 2;
}
#include"string.h"
int IsPerfectSquare(char n[50]);
main()
{
char n[50];
clrscr();
while(1)
{
printf("Would you like to play again?/n");
scanf("%s",&n);
if(IsPerfectSquare(n)==1)break;
if(IsPerfectSquare(n)==0)
{
printf("play game again./n");
}
if(IsPerfectSquare(n)==2)
{
printf("please answer yes or no./n");
}
}
getch();
}
int IsPerfectSquare(char n[50])
{
if(strcmp("yes",n)==0)
return 0;
if(strcmp("no",n)==0)
return 1;
return 2;
}