



main:(
INT default upb := 3;
MODE INTARRAY = [default upb]INT;
INTARRAY array = (1,2,3,4,5,6,7,8,9,10);
INT sum := 0;
FOR i FROM LWB array TO UPB array DO
sum +:= array[i]
OD;
# Define the product function #
PROC int product = (INTARRAY item)INT:
(
INT prod :=1;
FOR i FROM LWB item TO UPB item DO
prod *:= item[i]
OD;
prod
) # int product # ;
printf(($" Sum: "g(0)$,sum,$", Product:"g(0)";"l$,int product(array)))
)
int arg[] = { 1,2,3,4,5 };
int arg_length = sizeof(arg)/sizeof(arg[0]);
int *end = arg+arg_length;
int sum = 0, prod = 1;
int *p;
for (p = arg; p!=end; ++p) {
sum += *p;
prod *= *p;
}
my @list = ( 1, 2, 3 );
my ( $sum, $prod ) = ( 0, 1 );
$sum += $_ foreach @list;
$prod *= $_ foreach @list;
numbers = [1, 2, 3]
total = sum(numbers)
product = 1
for i in numbers:
product *= i
3 + 4
5 * 6
12 / 2
(3 + 5) / 4 "hallo"
"strings" + "plakken"
"hoepla".length 3 < 5
4 > 10
8 <= 8
9 >= 1
"dit" == "dat"
"iets" != "niets" true && false
false || true
false == !true var x; var y; x = 3; y = 4; x + y;x != y
alert("Hallo!");
confirm("Weet je het zeker?");
prompt("Groente of fruit?");if (3 < 4) {alert("Links");}else {alert("Rechts");}
var dubbel = function(x) { alert(x * 2); }dubbel(6);
var getal_raden = function(x) {var gok = prompt("Welk getal heb ik in mijn hoofd?");if (gok == x) {alert("Gefeliciteerd, je hebt het geraden! Knapperd");}else {if (gok < x) {alert("Nee joh, veel meer!");}else {alert("Oh, nee, dat is wel erg veel...");}getal_raden(x);}}