Write a C program to verify the String (a|b)*abb


#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
          int len,i;
          char str[50];
          clrscr();
          printf("\nEnter the String:-\n");
          gets(str);
          len=strlen(str)-1;
          if(str[len-2]=='a'&& str[len-1]=='b'&& str[len]=='b')
                   printf("Valid");
          else
                   printf("Invalid");
          getch();
}

Related Posts Plugin for WordPress, Blogger...

Engineering material

GTU IDP/ UDP PROJECT

GTU IDP/ UDP PROJECT

Patel free software download

  © Blogger templates The Professional Template by Ourblogtemplates.com 2008

Back to TOP