Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


what is the coding of display the factorial of a number
using array and function?



what is the coding of display the factorial of a number using array and function?..

Answer / balaji ganesh

#include<stdio.h>
int fact(int m)
{
int i,f=1;
for(i=m;i>0;i--)
f=f*m--;
return f;
}
void main()
{
int n,s;
clrscr();
scanf("%d",&n,printf("enter the number:"));
s=fact(n);
printf("factorial of %d is=%d",n,s);
getch();
}

Is This Answer Correct ?    6 Yes 1 No

Post New Answer

More C Interview Questions

What are operators in c?

0 Answers  


What are pointers in C?

5 Answers   KPIT,


How can I display a percentage-done indication that updates itself in place, or show one of those twirling baton progress indicators?

0 Answers  


What is the g value paradox?

0 Answers  


What are the different flags in C? And how they are useful? And give example for each in different consequences?

1 Answers  


1. What will be the output of the following programs. a) #include <stdio.h> Main() { Int x=4; While(x==1) { X=x-1; Printf(“%d”,x); --x; } }

7 Answers   CSC,


in ‘C’ language for Matrix Multiplication fails” Introspect the causes for its failure and write down the possible reasons for its failure.

0 Answers   TCS,


Are pointers really faster than arrays?

0 Answers  


Which is best book for data structures in c?

0 Answers  


How to implement call back functions ?

3 Answers   HP,


How many types of arrays are there in c?

0 Answers  


While(1) { } when this loop get terminate is it a infinite loop?

5 Answers  


Categories