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
having 2 arrays and 3killograms of pebbles are needed converting an area of 1 square meter the rate of pebble is $5 per killograms

Question: (a) (i) What is recursion? (ii) What advantage is there in its use? (iii) What disadvantage is there in its use? (b) The factorial of a positive number can b

A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindrome

Explain about the Character Constants in c language? The character constant is a single alphabet and a single digit or a single special symbol enclosed within a pair of single

write a program to generate padovan sequence in c++

Imagine that the server program is a setuid program owned by the root, then after you penetrate the program with a shell running, you become the ROOT and you can remove the whole f

write a pseudo code for computing sin(x) using sentinel control loop

Write a C# program to compute the Net Pay for employees. The program is to have a Main method and two user-defined methods. The Main method is to input the employee's name (string)

how do i write a c++ program that will input a number and output its factorial using the while loop

I need to make a fractal trees in OpenGL C++ . The method used is to write a recursive function with cylinders of different sizes and angles to create the tree trunk and branches.