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?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Why doesnt this code work?

1056


What is the difference between procedural and functional programming?

1072


Explain how can you restore a redirected standard stream?

1095


Explain what could possibly be the problem if a valid function name such as tolower() is being reported by the c compiler as undefined?

1005


What happens if a header file is included twice?

1034


what is the significance of static storage class specifier?

2249


What is array of structure in c programming?

1285


What are Macros? What are its advantages and disadvantages?

1156


What is an lvalue in c?

1122


What is the correct declaration of main?

1206


What's the total generic pointer type?

1050


Can you write the algorithm for Queue?

2102


Explain is it better to bitshift a value than to multiply by 2?

1194


What does c in a circle mean?

1067


Write a program with dynamically allocation of variable.

1118