Skip to content

krishnadevz/implementation-of-nfa-program-in-c

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

implementation-of-nfa-for-accepting-states-in-c

This code is error free but have a one warning and you doesnot get this code on google in c note it krishna's words

implement NFA over E={0,1} accepting the set of all strings that was binary integer, is divisible by 5. Eg. L={0,10011, 1001100,…} in c

Algorithm

  1.   Start of the program
    
  2.   Initialize variable for input and states
       in[100] and state;
    
  3.   Create a function tranFun() which takes a bit of input and current state as parameters and returns the transited state.
    
  4.   Run a loop which passes  bits of input and current state to the function tranFun()            
       Store the intermediate transition state into variable temp and replace the value of state by latest transition state
    
  5.   If the state is in accepting state then accept the string else reject the string.
    
  6.   End of program.
    

strlen( ) function counts the number of characters in a given string and returns the integer value. It stops counting the character when null character is found. Because, null character indicates the end of the string in C.

Last Someone solved that warning that guy have great welcome

HERE is the warning And Output of that Program


one

Author

Thank you .

Def the person who says he is programmer he takes code from one site resolved its bugs and convert it into another programming language that is called as programmer.