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 |
Can you please explain the difference between strcpy() and memcpy() function?
What are the parts of c program?
What is a newline escape sequence?
Write a program to reverse a string.
0 Answers Global Logic, iNautix, TCS, Wipro,
What are pointers? Why are they used?
What does #pragma once mean?
Devise a program that inputs a 3 digit number n and finds out whether the number is prime or not. Find out its factors.
Look at the Code: #include<string.h> void main() { char s1[]="abcd"; char s2[10]; char s3[]="efgh"; int i; clrscr(); i=strcmp(strcat(s3,ctrcpy(s2,s1))strcat(s3,"abcd")); printf("%d",i); } What will be the output? A)No output B) A Non Integer C)0 D) Garbage
who is the founder of c
19 Answers College School Exams Tests, HP,
Write a C program in Fibonacci series.
What is a shell structure examples?
what is a NULL pointer?