Skip to content
Snippets Groups Projects
Select Git revision
  • 8872f91f280e60287c4dba46de58f3f412e0a462
  • main default protected
  • jw_sonar
  • v6.0
  • ask-user-to-delete-exercises-on-duplicates
  • v5.0
  • open_tool_for_self_hosting
  • jw_sonar_backup
  • move-to-esm-only
  • v4.2
  • v4.1
11 results

ExerciceEnonce.ts

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);
    }