At 8/1/12 05:59 PM, doodle-bread14 wrote:
COBOL? How do you always remember those oldies? Barely anyone uses that language anymore.
Something that you gotta learn in the end of 20th century. I find my previous comment on it to be too irrelevant when I said it's useless. COBOL never meant for high level programming. (there is an OOP version calls COBOL 2002)
COBOL is probably the 2nd most used and still using oldest language, beside Assembly. it's slightly less frustrating than ASM.
* This program won't work, I put the wrong position for each line of codes...
$ SET SOURCEFORMAT"FREE"
* Condition names go here. See below.
PERFORM 3 TIMES
DISPLAY "Enter 1st num :" WITH NO ADVANCING
DISPLAY "Enter 2nd num : " WITH NO ADVANCING
DISPLAY "Operator (+ or *) : " WITH NO ADVANCING
IF Operator = "+" THEN
ADD Num1, Num2 GIVING Result
IF Operator = "*" THEN
MULTIPLY Num1 BY Num2 GIVING Result
DISPLAY "Result is = ", Result