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 |
List the difference between a "copy constructor" and a "assignment operator"?
Are the variables argc and argv are always local to main?
Explain demand paging.
Differentiate call by value and call by reference?
Hai,I have done with my bachelor of commerce and planing to ms,please suggest me how to convince vo for shifting from commerce to computers. Visa on 8 DEC 2014 Npu university
Can you mix old-style and new-style function syntax?
Explain the use of function toupper() with and example code?
Explain what is the benefit of using #define to declare a constant?
to find the program of matrix multiplication using arrays
When you call malloc() to allocate memory for a local pointer, do you have to explicitly free() it?
What is zero based addressing?
write a program to find the given number is prime or not
2 Answers Accenture, Vasutech,