answersLogoWhite

0

#include<stdio.h>

#include<conio.h>

void main()

{

int state[10];

int str[10],input[10];

char ch;

int x[20];

int s,n,k=0,j,a,i,l,t,q=0,fs,b,nxt;

clrscr();

printf("enter the no. states\n");

scanf("%d",&s);

printf("enter the no.of i/ps\n");

scanf("%d",&n);

for(i=0;i<s;i++)

{

printf("enter the state\n");

scanf("%d",&state[i]);

printf("is it final state?... .y..1/n..0\n");

scanf("%d",&a);

if(a==1)

fs=state[i];

}

printf("enter the i/ps\n");

for(i=0;i<n;i++)

scanf("%d",&input[i]);

printf("transition state\n");

for(i=0;i<s;i++)

{

for(j=0;j<n;j++)

{

printf("(q%d,%d)=q",state[i],input[j]);

scanf("%d",&b);

x[k]=b; k++;

}

}

printf("enter the length of string\n");

scanf("%d",&l);

printf("enter the i/p string\n");

for(i=0;i<l;i++)

scanf("%d",&str[i]);

for(i=0;i<l;i++)

{

t=0;

do

{

if(str[i]==input[t])

{

nxt=x[n*q+t];

for(j=0;j<s;j++)

{

if(nxt==state[j])

q=j;

}

t++;

}

else

t++;

}

while(t!=n);

}

if(nxt==fs)

printf("\n string is accepted\n");

else

printf("\n not accepted\n");

getch();

}

User Avatar

Wiki User

14y ago

What else can I help you with?

Continue Learning about Engineering

What is ABB power systems?

ABB Power Systems is a division of ABB, a global technology company specializing in electrification and automation solutions. This division focuses on providing advanced technologies and services for power generation, transmission, and distribution, including smart grids and renewable energy integration. ABB Power Systems aims to enhance the efficiency, reliability, and sustainability of power systems worldwide, supporting the transition to a low-carbon energy future. Their offerings include software, hardware, and engineering services tailored to meet the diverse needs of utilities and industrial customers.


What is the programming language used by ABB?

It's called RAPID. RAPID functions and looks quite similar to C


Who invented vacuum circuit breaker?

first of all what kinda person asks thiz stup. question??? -cyco.


What is the Frequency of an ABB A410 Drive?

The frequency of an ABB A410 Drive typically ranges from 0 to 400 Hz, allowing for precise control of motor speed in various applications. This variable frequency drive (VFD) adjusts the output frequency to match the requirements of the connected motor, facilitating optimal performance. Users can set the frequency according to their specific application needs using the drive's programming interface.


Single phase to three phase conveter for driving three phase motor using single phase?

This inverter is the cheapest and always available from famous vendors like ROCKWELL ,ABB, SIEMENS ,SCHNEIDER ELECTRIC....etc .