fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <limits.h>
  4. int main()
  5. {
  6.  
  7. int x=3;
  8. int y = 1;
  9. int N = 1;
  10. int f;
  11. printf("Enter positive number value\n");
  12. //scanf("%d", &x);
  13.  
  14. do
  15. {
  16. y = N;
  17. N = N + 1;
  18. f = y * N;
  19. }while( N <= x);
  20. printf("f = %d", f);
  21.  
  22. return 0;
  23. }
  24.  
Success #stdin #stdout 0s 9432KB
stdin
4
stdout
Enter positive number value
f = 12