answersLogoWhite

0

to find the factorial we declare a variable n and initialize its value to 1

initiate a loop for example a for loop and multiply the numbers upto 5

code:-

for(i=1,n=1;i<=5;i++)

{

n=n*i;

}

User Avatar

Wiki User

14y ago

What else can I help you with?

Related Questions

What is the value of abc if abc equals a factorial plus b factorial plus c factorial?

145 1! = 1 4! = 24 5! = 120


output of a c program using function to find factorial of a number?

In a C program that calculates the factorial of a number using a function, the program typically prompts the user for an integer input. The function then recursively or iteratively computes the factorial by multiplying the number by the factorial of the number minus one until it reaches one. For example, if the user inputs 5, the program outputs 120, as 5! = 5 × 4 × 3 × 2 × 1. The final result is displayed on the screen.


Where can one find C programming tutorials?

You can find C programming tutorials online at the C programming website. They provide both free and paid tutorials for many aspects of the C and C++ code.


How do you create factorial program in qbasic?

since factorial is for example , the factorial of 5 = 5 (5-1)(5-2)(5-3)(5-4) that means the last number to subtract from 5 is 4 , which is (n-1) ie the factorial of any number is (n-0)(.............)(n-(n-1)) to write this , 5 REM to calculate the factorial of any number 6 DIM fac AS INTEGER LET fac = 1 10 INPUT "enter the number to find its factorial "; a ' variable a 15 FOR b = 0 TO (a-1) 'numbers that will be subtracted from the " a" 20 c= a -b 'each number in the factorial calculation 25 fac = fac * c 'to compute each multiplication in the factorial 30 NEXT b 35 PRINT 'to leave a line 40 PRINT fac 45 END note this due to some unattained raesons works for numbers 0 to 7


C program to find factorial of a no?

this is a code for calculating it recursivelly: float Factorial (float n) { if (n&lt;=1) return 1.0; else return n* Factorial(n-1); }


Write a C program to find out factorial if 10?

Here's a simple C program to calculate the factorial of 10: #include &lt;stdio.h&gt; int main() { int i; unsigned long long factorial = 1; // Use unsigned long long for larger results for(i = 1; i &lt;= 10; i++) { factorial *= i; } printf(&quot;Factorial of 10 is %llu\n&quot;, factorial); return 0; } This program uses a loop to multiply numbers from 1 to 10 and stores the result in factorial, which is then printed.


What is the logic and theory for pascal triangle program in C?

long factorial(int); int main() { int i, n, c; printf("Enter the number of rows you wish to see in pascal triangle\n"); scanf("%d",&n); for ( i = 0 ; i < n ; i++ ) { for ( c = 0 ; c


Wap to represent a pascal triangle?

it's easy i am assuming you know programming as you are asking a question of a high standard. The formula for any number in the traingle is (r-1)!/[(c-1)!*(r-c)!] where r represents row number and c represents column number. Note:- '!' sign means factorial. Eg:- 5! = 5 x 4 x 3 x 2 x1.


Find the dimensions of the rectangle of largest area that can be inscribed in a circle of radius a in C programming?

Find the dimensions of the rectangle of largest area that can be inscribed in a circle of radius a in C programming


Where can one find a board or forum for C?

There is a website that you may find interesting called Programming Forums. On this site, there are many people talking about programming languages, including C.


What programming language was Call of Duty 5 written in?

C++


What the answer of give 5 programming language influence by c language?

It would be a list of five programming languages.