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

What are the types of data types and explain?

1035


What is pass by reference in functions?

771


What is a structure member in c?

956


Tell me what are bitwise shift operators?

1091


C language questions for civil engineering

1653


what are non standard function in c

1849


What are global variables and how do you declare them?

1016


Why C language is a procedural language?

976


What is the difference between a string and an array?

1153


i = 25;switch (i) {case 25: printf("The value is 25 ");case 30: printf("The value is 30 "); When the above statements are executed the output will be : a) The value is 25 b) The value is 30 c) The value is 25 The value is 30 d) none

1010


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

961


Write a C++ program to generate 10 integer numbers between - 1000 and 1000, then store the summation of the odd positive numbers in variable call it sum_pos, then find the maximum digit in this variable regardless of its digits length.

1947


Explain what is the purpose of "extern" keyword in a function declaration?

1029


How can I read and write comma-delimited text?

1010


Is that possible to add pointers to each other?

1319