Let’s write a programme to find factorial of a number in C.
Step 1: First of all ,we should open turbo c/c++ and write the following code in it.
// Add preprocessor file
// Declare variables
long int i=1,n,fact=1;
printf(“enter any no”);
//asign value in variable n
// print the result
Step 2: Save it by pressing F2 or click on File and then click on Save As then name it Fact.CPP and click OK.
Step 3: Now, you have to compile it by click on compile or by pressing ALT +F9 for find errors and correct them.
Step 4: After compile the code, press Alt+R to run the program and see output.