Monday 15 February 2010

c - Do you want to continue(y/n) issue -



c - Do you want to continue(y/n) issue -

do want go on (y/n) doesn't work in c code. want inquire come in string when type 'y' , exit programme if type n. have tried many options, no avail. help

{ = 0, final = 0, s = 0; printf("\n\nenter input string.. "); scanf("%s", string); while (string[i] != '\0') if ((s = check(string[i++], s)) < 0) break; (i = 0 ; < nfinals ; i++) if (f[i] == s ) final = 1; if (final == 1) printf("\n string accepted"); else printf("string rejected"); printf("\ndo want continue.? \n(y/n) "); } while (getch() == 'y'); homecoming getch(); }

if (getch() == 'n') { // print return; }

c

No comments:

Post a Comment