I have problem with this portion of program..I executed it but it showed this type of error
"ttt.c", line 163: Error: "}" expected instead of "defined".
"ttt.c", line 165: Error: "}" expected instead of "defined".
2 Error(s) detected.
line 163 refers to scnf("%d",&choice);
line 165 refers to switch(choice)
I compile using Sun Microsystem.
This is the program.
Code:
#include<stdio.h>
int main()
{
int choice=0; /* this just holds the answer for the menu */
char playagain = 'y'; /* y to play again, n to quit */
do
{
printf(" T I C\n");
printf(" -----------\n");
printf(" T A C\n");
printf(" -----------\n");
printf(" T O E");
printf("\n\n");
printf("Type 1 to proceed and type 0 to quit\n");
printf("Choice : ");
scanf("%d", &choice);
switch (choice)
{
case 0 : printf("Thank you for playing TIC TAC TOE.\n");
playagain = 'n';
break;
default : printf("ERROR!\n");
break;
}
}
while (playagain == 'y');
return 0;
}