Yes, with BASIC. When there were very few PCs in Ahmedabad.
I learnt programming with BASIC. The credit goes to my elder brother, Santosh, who convinced me (against my self-doubts) that I could learn computer programming. And once I started, it was SO EASY (I topped the class).
Thank you , Santosh.
Here's a YABASIC program I wrote in 2007 to help my son solve a puzzle (and I don't remember the details of the puzzle) :
print "The problem of 3 daughters"
print "Find 3 numbers whose product equals the desired number"
input "What is the product of the 3 integers ?" productof3
FOR I =1 to productof3
IF INT(productof3/I) = (productof3/I) THEN
FOR J =1 to productof3
IF INT(productof3/J) = (productof3/J) THEN
For K = 1 to productof3
IF INT(productof3/K) = (productof3/K) THEN
# print "Testing ", I , J , K
IF (I * J * K) = productof3 THEN
# print "Possible Answer : ", I , J, K, " : With the Sum as : ", S\
FOR ARRCHK =1 to RN
S = I + J + K
IF ( (AM(ARRCHK,1)=S AND AM(ARRCHK,2)=I AND AM(ARRCHK,3)=J AND AM(ARRCHK,4)=K) OR (AM(ARRCHK,1)=S AND AM(ARRCHK,2)=I AND AM(ARRCHK,3)=K AND AM(ARRCHK,4)=J) OR (AM(ARRCHK,1)=S AND AM(ARRCHK,2)=J AND AM(ARRCHK,3)=I AND AM(ARRCHK,4)=K) OR (AM(ARRCHK,1)=S AND AM(ARRCHK,2)=J AND AM(ARRCHK,3)=K AND AM(ARRCHK,4)=I) OR (AM(ARRCHK,1)=S AND AM(ARRCHK,2)=K AND AM(ARRCHK,3)=I AND AM(ARRCHK,4)=J) OR (AM(ARRCHK,1)=S AND AM(ARRCHK,2)=K AND AM(ARRCHK,3)=J AND AM(ARRCHK,4)=I) ) THEN
# print ".............. Numbers ", I, J, K, " have already been checked"
IF DOESEXIST=0 THEN
print "Possible Answer : " , AM(RN,2), AM(RN,3), AM(RN,4) , " : With the sum : ", AM(RN,1)
RN = RN +1
Or an example of a program to test a number for whether it is a Prime (very simplistic, not using any of the algorithms -- like the Sieve of Eratosthenes that I used when I wrote a program in the BASIC class in 1985 -- or was it in 1984) :
print "hello world"
# Testing for Prime Numbers
input "Which number ?" numtotest
print "You entered : " , numtotest
for I=2 to numtotest/2
IF (numtotest/I) = int(numtotest/I) THEN
# print "Testing division of ", numtotest, "by ", I , " : Is Not a Prime"
# print "possibly a prime when testing division by ", I
if presult=0 then
print colour("red","blue") numtotest, " IS A PRIME NUMBER !"
print colour("green") numtotest, " is not a prime number !"
input "Enter to exit " mentr
I have also studied xBase (dBASEIII+), Pascal, C, C++ and Java (besides SQL and PL/SQL). Guess which language I dislike ? It is a 4 letter word.
UPDATE 01-Jul-11 : Here's an article by Joel Spolsky (albeit dated 29-Dec-05) : The Perils of JavaSchools.