Fahad/MCG-CS/Code/for-loop.kcl
author Christian Urban <urbanc@in.tum.de>
Fri, 25 Aug 2017 23:52:49 +0200
changeset 270 462d893ecb3d
parent 45 7545b1bc1514
permissions -rw-r--r--
updated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
45
7545b1bc1514 msc project
Fahad Ausaf <fahad.ausaf@kcl.ac.uk>
parents:
diff changeset
     1
var ntimes = 0;
7545b1bc1514 msc project
Fahad Ausaf <fahad.ausaf@kcl.ac.uk>
parents:
diff changeset
     2
print "Rate King's College from 1 to 10";
7545b1bc1514 msc project
Fahad Ausaf <fahad.ausaf@kcl.ac.uk>
parents:
diff changeset
     3
read ntimes;
7545b1bc1514 msc project
Fahad Ausaf <fahad.ausaf@kcl.ac.uk>
parents:
diff changeset
     4
var x = 0;
7545b1bc1514 msc project
Fahad Ausaf <fahad.ausaf@kcl.ac.uk>
parents:
diff changeset
     5
var y = 0;
7545b1bc1514 msc project
Fahad Ausaf <fahad.ausaf@kcl.ac.uk>
parents:
diff changeset
     6
for x = y to ntimes do
7545b1bc1514 msc project
Fahad Ausaf <fahad.ausaf@kcl.ac.uk>
parents:
diff changeset
     7
   print "King's College is the best";
7545b1bc1514 msc project
Fahad Ausaf <fahad.ausaf@kcl.ac.uk>
parents:
diff changeset
     8
end;
7545b1bc1514 msc project
Fahad Ausaf <fahad.ausaf@kcl.ac.uk>
parents:
diff changeset
     9
print "press any key to continue...";
7545b1bc1514 msc project
Fahad Ausaf <fahad.ausaf@kcl.ac.uk>
parents:
diff changeset
    10
var continue = 0;
7545b1bc1514 msc project
Fahad Ausaf <fahad.ausaf@kcl.ac.uk>
parents:
diff changeset
    11
read continue;