Create DFA for all the String Combination of 0&1 which doesn’t allow Substring 001


#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
          char str[50];
          int i,len,flag;
          clrscr();
          printf("\n Enter the String:-");
          gets(str);
          len=strlen(str)-1;
          for(i=0;i<len;i++)
          {
                   if(str[i]=='0' && str[i+1]=='0' && str[i+2]=='1')
                             flag=1;
          }
          if(flag==1)
                   printf("\n INValidddd.....");
          else
                   printf("\n Valid String");
  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