#include<conio.h> #include<conio.h> #include<stdio.h> #include<string.h> void main(void) { clrscr(); int i=0; char str[30]; printf("Enter the input string: "); gets(str); if(str[i]=='a') { str[i++]; if(str[i]=='b') { str[i++]; if(str[i]=='a') { str[i++]; if(str[i]==NULL) { printf("\nVALID"); } else { loop: ; if(str[i]=='a'|| str[i]=='b') { str[i++]; goto loop; } else { goto a; } a: ; if(i%2==0) { printf("\nVALID"); } else { printf("\nINVALID"); } } } else { printf("\nINVALID"); } } else { printf("\nINVALID"); } } else { printf("\nINVALID"); } getch(); } Please correct my code??</string.h></stdio.h></conio.h>
str[i++]; //its is enough i++;
if(i%2==0)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)