Posts

Showing posts with the label DFA in C Code

How To Implement DFA in C Code

Image
Implementing DFA in C Program If You need the .Exe File i will provide it.. 1:  /*   2:  *PROGRAM NAME: DFA.C 3:  *AIM : TO IMPLEMENT DFA 4:  *DATE : 07/28/2011 5:  */ 6:  #include<stdio.h> 7:  //nt a[10],b[10]; 8:  char letters[10]; 9:  int letter_count,count,final; 10:  int final_states[5]; 11:  void DEFINE_DFA(); 12:  int MOVE_DFA(int,char); 13:  int dfa[10][10]; 14:  int main() 15:  {   16:     int s,i,accepted; 17:     char line[10]; 18:    printf("\t\tDFA SIMULATOR\n\t******************************\n"); 19:    DEFINE_DFA(); 20:    do 21:    { 22:    s=0; 23:    i=0; 24:    accepted=0; 25:    printf("\n\nEnter Input String.. "); 26:    scanf("%s",line); 27:    while(line[i]!='\0') 28:    if((s=MOVE_DFA(s,line[i++]))<0) 29...