Question: c + + draw flow chart for this code to undestand it #include #include #include int main ( ) { char st [ 5 0

c++
draw flow chart for this code to undestand it
#include
#include
#include
int main(){
char st[50], start, temp;
std::cout << "Enter your grammar:";
gets(st);
start = st[0];
for (int i =0; i <= strlen(st); i++){
if (st[i]=='>'){
temp = st[i +1];
}
if ((st[i]=='|')||(st[i]=='\0')){
if ((temp == st[i -1]) && (temp == start)){
std::cout << st <<"------- Ambiguity Grammar.";
return 0;
}
temp = st[i +1];
}
}
std::cout << st <<"------- Not Ambiguity Grammar.";
return 0;
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!