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

Explain how do you list files in a directory?

1012


What is a header file?

1025


What is define c?

996


What is function prototype in c with example?

998


Is Exception handling possible in c language?

1987


What is the best style for code layout in c?

1041


Write a program to implement queue.

1065


What are the types of c language?

973


Differentiate between the = symbol and == symbol?

1205


Explain the use of keyword 'register' with respect to variables.

967


write a program using linked list in which each node consists of following information. Name[30] Branch Rollno Telephone no i) Write the program to add information of students in linked list

2737


How do c compilers work?

1043


What is huge pointer in c?

1019


Explain modulus operator.

990


why to assign a pointer to null sometimes??how can a pointer we declare get assigned with a garbage value by default???

1908