The purpose of this exercise is to write a syntax generator
The purpose of this exercise is to write a syntax generator for a subset of the C++ programming language that will write \"random\" C++ programs to a file. By writing these random syntactically correct programs, you will further develop your understanding of the difference between syntax and Semantics. Consider the following set of productions that define a subset of the C++ programming language: wint maino
Solution
Using namespace std;
main()
{
Int n,max,num,C;
Count <<\" put your input\"
Cin >> n;Cout <<\"maximum value\";
Cin>>max;
Cout<<\"random numbers 0 to\" << max \"\" <<end1;
For( c=1; C<=n; C ++)
Num= random (Max)
Cout <<num<< end1;
}
Return 0;
}
