OpenCores
URL https://opencores.org/ocsvn/m1_core/m1_core/trunk

Subversion Repositories m1_core

[/] [m1_core/] [trunk/] [tests/] [fact.c] - Rev 54

Compare with Previous | Blame | View Log

// Factorial
 
int main() {
  int num = 5;
  int fact = fact_f(num);
  return 0;
}
 
int fact_f(int n) {
  if(n==1) return 1;
  else return n*fact_f(n-1);
}
 
 

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.