Skip to main content
MedCalc
Mail a PDF copy of this page to:
(Your email address will not be added to a mailing list)
working
Show menu Show menu

For loop

Scripts example - For loop

// regional settings
$decimalsymbol=".";
$listseparator=",";
// for loop example
sum=0;
for (i=1; i<=10; i++) 
{ 
	sum=sum+i; 
}
print("sum = ",sum); println;

Output

sum = 55

See also