Compiler Design - Limit the Method Instructions, C/C++ Programming

Raj is a newbie to the programming and while learning the programming language he came to know the following rules:


· Each program must start with ''{'' and end with ''}''.

· Each program must contain only one main function. Main function must start with ''<'' and end with ''>''.

· A program may or may not contain user defined function(s). There is no limitation on the number of user defined functions in the program. User defined function must start with ''('' and end with '')''.

· Loops are allowed only inside the functions (this function can be either main function or user defined function(s)). Every loop must start with ''{'' and end with ''}''.

· User defined function(s) are not allowed to be defined inside main function or other user defined function(s).

· Nested loops are allowed.

· Instructions can be anywhere inside the program.

· Number of instructions inside any user defined function must not be more than 100.



If any of the above conditions is not satisfied, then the program will generate compilation errors. Today Raj has written a few programs, but he is not sure about the correctness of the programs. Your task is to help him to find out whether his program will compile without any errors or not.
Posted Date: 8/3/2015 5:56:19 AM | Location : USA







Related Discussions:- Compiler Design - Limit the Method Instructions, Assignment Help, Ask Question on Compiler Design - Limit the Method Instructions, Get Answer, Expert's Help, Compiler Design - Limit the Method Instructions Discussions

Write discussion on Compiler Design - Limit the Method Instructions
Your posts are moderated
Related Questions
(a) Write a procedure called (add x y) that adds two numbers in a recursive manner. Specifically, note that x + y = (x + 1) + (y - 1) and x + 0 = x. (b) Using the substitution m

Write a program that reads data into an array of type int. You must use an array. The numbers input are attendance numbers at a conference. Keep a running average, number of events

Aim: To implement a program to handle stack overflow, underflow and odd number exception using Exception Handling. Code: #include #include #include #define MAX

how are metric numer change the number of metric

6999066263304447777077766622337778 -----> message sent by the first smuggler. my name is robert---------> message decoded by the second smuggler. Where ‘0’ denotes the "space".

#include long BixFunction(int x, int y = 5, float z = 5) { return(++x * ++y + (int)++z); } int main() { cout return 0; }

switch statement

Write a program that does the following: Calculates the Velocity and Momentum of an object. The formula for the velocity is V=d/t and the formula Momentum is m=mass*velocity. Your

answer for tcs is working question

Enumerated Constants Enumerated constants enable the creation of new types and then explain variables of these types so that their values are restricted to a set of possible va