#include
main()
{
int i=1;
do
{
char a[100];
printf("Who is the winner of 2007 cricket world cup\t:");
scanf("%s",a);
if (strcmp(a,"australia")==0||strcmp(a,"AUSTRALIA")==0||strcmp(a,"Australia")==0)
{
printf("Right Answer\n");
break;
}
else if(i<=2 && strcmp(a,"australia")!=0 && strcmp(a,"AUSTRALIA")!=0&&strcmp(a,"Australia")!=0)
printf("Sorry,Wrong Anser try again\n");
else if(i==3 && strcmp(a,"australia")!=0 && strcmp(a,"AUSTRALIA")!=0&&strcmp(a,"Australia")!=0)
{printf("\nThis time also you entered wrong answer\n\n");
printf("\n\t\t\tCorrect Answer is : Australia \n\n");
}
}
while(i++ && i<4);
}
No comments:
Post a Comment