Thursday, August 30, 2012

Design a new programming language GOOGELY.

The programming language consists of two global character registers X and Y. Both X and Y is initialized with A initially.

It consists of two instructions
next: It increments the contents of x. Resets it to ‘A’ if it was ‘Z’.
Print: Prints the value of X and swaps the value of X and Y.

Sample input for the program: A string say “CBC”
Sample output: Sequence of instruction needed to execute, to obtain the input string.
In this case this output would be “next next print next print print“.

No comments :