Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 1

Assignment No.

2
[8+4]
(a) Write down a program in SNOBOL that calculates the sum of integers from 1 to 35
using loop (use goto field for conditional jumps as there is no explicit loop statement in
SNOBOL).
Answer:
sum=0
term=1
loop sum=sum+term
term=term+1
LE(term,35)
OUTPUT = "The sum is" sum
END

(b) Briefly explain at least 2 features that are unique in SNOBOL (not present commonly
in programming languages). Explanation of each feature should not be more than two
lines.

Answer:
It is designed for quick and dirty string manipulation/pattern matching. It was one of the
first languages to use a virtual machine thus anticipating Java and the like. It has since
been out-quicke and out-dirtied by newer languages and tools such as Perl.

You might also like