2018-09-25 18:31:29 +02:00
|
|
|
#include <stdint.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
|
|
|
|
#include "platform.h"
|
|
|
|
#include "encoding.h"
|
|
|
|
|
|
|
|
int factorial(int i){
|
|
|
|
|
|
|
|
volatile int result = 1;
|
|
|
|
for (int ii = 1; ii <= i; ii++) {
|
|
|
|
result = result * ii;
|
|
|
|
}
|
|
|
|
return result;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
volatile int result = factorial (10);
|
2018-09-26 08:07:48 +02:00
|
|
|
printf("Factorial is %d\n", result);
|
2018-09-25 18:31:29 +02:00
|
|
|
printf("End of execution");
|
|
|
|
return 0;
|
|
|
|
}
|