write a program that finds the factorial of a number using
recursion?
Answer Posted / danish
>
#include<conio.h>
int fact(int);
void main()
{
int num,fact1;
clrscr();
printf("Enter a value of num");
scanf("%d",&num);
fact1=fact(num);
printf("factorial=%d",fact1);
}
int fact(int n)
{
if(n==0)
{
return 1;
}
else
{
return
| Is This Answer Correct ? | 13 Yes | 8 No |
Post New Answer View All Answers
What is the benefit of using #define to declare a constant?
hello freinds next week my interview in reliance,nybody has an idea about it intervew questions..so tell
What is a macro?
What is the newline escape sequence?
Why is it that not all header files are declared in every C program?
The file stdio.h, what does it contain?
.main() { char *p = "hello world!"; p[0] = 'H'; printf("%s",p); }
write a c programming using command line argument,demonstrate set operation(eg;union,intersection,difference) example output is c:>setop 12 34 45 1 union 34 42 66 c:>setop 12 34 1 42 66 c:>setop 12 34 diff 12 56 67 78 setop 12 34
What does sizeof int return?
What does void main () mean?
A global variable when referred to in another file is declared as this a) local variable b) external variable c) constant d) pointers
a construct the"else" part of "if" statement contains anoth "if else" statement is called a) if-else b) else-if-else c) if-else-if-else d) chain if/if-else-if
Create a structure to specify data on students given below: Roll number, Name, Department, Course, Year of joining Assume that there are not more than 450 students in the college. 1.write a function to print names of all students who joined in a particular year 2.write a function to print the data of a student whose roll number is given
Are there constructors in c?
what is stack , heap ,code segment,and data segment