Skip to content
Snippets Groups Projects
Select Git revision
  • 2fc06c516d1800f51d224251eb7d31e317628ec0
  • main default protected
  • 3-add-makefile-with-structure
  • 9-add-destroy-function-4
  • 4-add-create-init-function
  • 5-add-push-function-2
  • 9-add-destroy-function-3
  • 9-add-destroy-function-2
  • v0.1
9 results

stack.c

Blame
  • factorielle.c 401 B
    #include <stdio.h>
    // Programme calculant la factorielle d'un nombre
    void main() {
       int nb = 1;
       printf("Entrer un nombre: ");
       scanf("%d",&nb);
       int fact = 1;
       for(int i=2;i<=nb;i++) {
          fact *= i;
       }
       /*int iter = 2;
       while(iter <= nb) {
          fact *= iter;
          iter++;
       }
       do {
          fact *= iter;
          iter++;
       } while(iter <= nb);*/ 
       printf("Fact = %d\n",fact);
    }