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 |
1 1 1 1 2 1 1 3 3 1 1 4 6 4 1
why we use "include" word before calling the header file. is there any special name for that include??????
write a program in C that prompts the user for today's date,tomorrow's date and display the results.Use structures for today's date,tomorrow's date and an array to hold the days for each month of the year.
triangle number finding program...
Write a program to print the following series 2 5 11 17 23 31 41 47 59 ...
What is the benefit of using an enum rather than a #define constant?
Tell us the use of fflush() function in c language?
What is a string?
main() { int a=4,b=2; a=b<<a + b>>2; printf("%d", a); }
What is the difference between if else and switchstatement
what is real time system?what is the differance between hard and soft real time systems
program to print circle structure