2016 Update

This commit is contained in:
Tina Müller 2016-12-05 22:15:40 +01:00
parent 948b86eafa
commit dcf5d15da3
7965 changed files with 139854 additions and 31002 deletions

View file

@ -1,3 +1,10 @@
Some programming languages allow calculation of values at compile time. For this task, calculate 10! at compile time. Print the result when the program is run.
Some programming languages allow calculation of values at compile time.
;Task:
Calculate &nbsp; <big> 10! </big> &nbsp; (ten factorial) &nbsp; at compile time.
Print the result when the program is run.
Discuss what limitations apply to compile-time calculations in your language.
<br><br>

View file

@ -0,0 +1,6 @@
#include <stdio.h>
const int val = 2*3*4*5*6*7*8*9*10;
int main(void) {
printf("10! = %d\n", val );
return 0;
}

View file

@ -1,3 +1,6 @@
/*REXX program to compute 10!*/ say '10! =' !(10); exit
/*REXX program computes 10! (ten factorial) during REXX's equivalent of "compile─time". */
!: procedure; !=1; do j=2 to arg(1); !=!*j; end; return !
say '10! =' !(10)
exit /*stick a fork in it, we're all done. */
/*──────────────────────────────────────────────────────────────────────────────────────*/
!: procedure; !=1; do j=2 to arg(1); !=!*j; end /*j*/; return !