Code: Select all
; printf under PB_C
CompilerIf #PB_Compiler_ExecutableFormat<>#PB_Compiler_Console
CompilerError "Exec-Format must be Console in Compiler-Option"
CompilerEndIf
;! int fact(int);
! int fact(int n) {
! if(n>=1)
! return n*fact(n-1);
! else return 1;
! }
OpenConsole()
! int number;
! printf("Enter a positive integer: ");
! scanf("%d",&number);
! printf("Factorial of %d = %d", number, fact(number));
Input()
CloseConsole()

Happy coding !