C示例因子计划

Python/Java学习交流群:369606713


C示例因子计划

#include <stdio.h>



int main() {

   int loop;

   int factorial=1;

   int number = 5;



   for(loop = 1; loop<= number; loop++) {

      factorial = factorial * loop;

   }



   printf("Factorial of %d = %d \n", number, factorial);



   return 0;

}