write a programe to find the factorial of given number
using recursion
Answers were Sorted based on User's Feedback
Answer / hari.11
t fact(int n)
{
if(n==1)
return 1;
else
return(n*fact(n-1));
}
for further queries and discussions, just check these out !!!
http://forum.campusmaniac.com/
http://www.campusmaniac.com/
| Is This Answer Correct ? | 2 Yes | 2 No |
Answer / jessie
import util.java.Scanner
class factorial
{
public static void main(string arge[])
{
Scanner s=new Scanner(System.in);
int n=new int();
n=s.nextInt();
fact(n);
fact(int n)
{
if(n==1)
return 1;
else
return (n*fact(n-1));
}
System.out.println("the factorial of number is "+n);
}
}
| Is This Answer Correct ? | 1 Yes | 2 No |
Identify the operators that is not used with pointer a. && b. # c. * d. >>
could u able to tell about suresoft technical session
Where static variables are stored in memory in c?
Write a program for the following series? 1 121 12321 1234321 123454321 12345654321 1234567654321 123456787654321 12345678987654321 1234567890987654321 123456789010987654321 12345678901210987654321 1234567890123210987654321 .........1234321............ ..........123454321............ ..........12345654321............ 7 8 9 0 1 Pls............?
write a program for fibonaci series by using while loop in c?
can we write a program in c for printf and scanf without using header file stdio.h
What are the different flags in C? And how they are useful? And give example for each in different consequences?
what will be the output of this program main() { int i=1; while (i<=10); { i++; } }
how to write a cprogram yo get output in the form * *** ***** ******* ********* ******* ***** *** *
what is the use of fflush() function?
how does printf function work
please give me some tips for the placement in the TCS.