answersLogoWhite

0


Best Answer

#include int main() { int fact,Factorial; printf("Please Enter Factorial Number\n"); scanf("%d",&fact); Factorial=func_fact(fact); printf("factorial is %d\n",Factorial); } int func_fact(int number) { int i; int factorial=1; for(i=number;i>=1;i--) { factorial=factorial*i; } return factorial; }

User Avatar

Wiki User

โˆ™ 2010-01-06 05:39:36
This answer is:
๐Ÿ™
0
๐Ÿคจ
0
๐Ÿ˜ฎ
0
User Avatar
Study guides

Factorial number's summation's program upto n numbers in c language

F chromatic scale clarinet

โžก๏ธ
See all cards

Factorial number's summation's program upto n numbers in c language

โžก๏ธ
See all cards

Add your answer:

Earn +20 pts
Q: Factorial in c program using for loop?
Write your answer...
Submit
Related questions

Find factorial using for loop?

c program maze


Using do while statement write cprogram for factorial number?

using c program write factorial number with do..while statement


How a C program to find LCM using while loop?

how to find the lcm using while loop


How do you create a Pascal triangle using only one 'for' loop using C?

#include long factorial(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


7 Write a C program to compute the factorial of a number using for loop?

int factorial(int n) { int i; int f=1; for(i=2;i&lt;=n;++i) f*=i; return f; }


How do you find the factorial using while loop in c plus plus?

unsigned __int64 factorial(unsigned __int64 number) { unsigned __int64 factorial=1; while(number) factorial*=number--; return(factorial); }


Write a c program Fibonacci series using for loop in java?

Exactly what do you mean by 'C program in Java'


How do you write a c program to design calculator using loop?

Wr


C program algorithm for simple interest using while loop?

Not used


For loop in turbo c program?

Yes, you can use for-loop in a C program compiled by Turbo C.


Binary search program in c using for loop?

C program for Performing Binary Search http://thingsoverflow.com/?p=211


Write a c program to print even numbers using for loop?

Yes, yes, please do.


Sum three real numbers using for loop in c program?

take input n chodo


Create a c program that would print 1123581321 using for loop?

for (i=0; i&lt;1; ++i) puts ("1123581321");


How do you write a C plus plus program that displays a pyramid of Xes on the screen using a for loop?

printf ("x")


What applications of recursion in C programming?

Recursion is a replacement of loop in programming.Recursive programming techniques are not recommended as it may lead to non terminating conditions and finally program crash.Recursion is only recommended if the program demands it. Mainly Recursion is used for Operations like calculating factorial of a program.


What is odd loop in 'C' program?

odd loop means at least the loop execute once.


Write a C-like program fragment that calculate the factorial function for argment 12 with do while loop?

#!/usr/bin/perl print factorial($ARGV[11]); sub factorial { my($num) = @_; if($num == 1) { return 1; # stop at 1, factorial doesn't multiply times zero } else { return $num * factorial($num - 1); # call factorial function recursively } }


Write a c program to print all prime numbers from 1 to n by using for loop?

Yes, please do write.


Program to find factorial of a number using recursion?

A C, C#/Java code segment:int Factorial(int n) {if (n


What are the merits and demerits of factorial using recursion in c?

Pros: it's easy ie: factorial int factorial(int n) { return n&gt;=1 ? n * factorial(n-1) : 1; } Cons: your program can crash because of it's stack limit. In example above try n=200 :)


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


Algorithm for factorial in c?

To get the factorial of a number, "n", do one of the following: 1) Multiply all numbers from one to "n". To do this, assign the number 1 to the result, then write a loop (from 1 to n) that will multiply result by each of the numbers the loop counter assumes. 2) Another method is to use recursion. If n = 0, return 1; otherwise, the factorial of n is equal to n * factorial(n - 1).


How do you display stars in c plus plus using the if else structure and a for loop and you use void main?

It depends on what program you design really


How do you write a c program sum of ALL Numbers in the Given Range using for loop?

Reference: cprogramming-bd.com/c_page3.aspx#for%20loop

People also asked

What is 35 factorial?

View results