include<stdio.h>
main()
{
int n,fact=1;
clrscr();
printf("enter a no");
scanf("%d",&n);
while(n>0)
{
fact=fact*n;
n--;
}
printf("the factorial of given no is %d",fact);
getch();
}
int n, f=1;
printf("Enter a number= ");
scanf(%d,&n);
while(n>1)
{
f=f*n;
n--;
}
printf("Factorial of number %d is %d",n,f);
}
#! /usr/bin/env ruby
def fac(n)
return 1 if n<=1
return n * fac(n-1)
end
puts fac(gets.to_i)
int fact (int n) {
if (n==0) return 1;
return n* fact(n-1);
}
write an algorithm to print the factorial of a given number and then draw the flowchart. This looks like someones homework, defiantly someone looking for the easy way. When it comes to programming, the more you do the better you get. Experience counts (making your own mistakes and learning from the mistake).
a write the algorithm to concatenate two given string
please give me an algorithm and a corresponding flow chart that displays list of numbers from 1 to 20.
double factorial(double N){double total = 1;while (N > 1){total *= N;N--;}return total; // We are returning the value in variable title total//return factorial;}int main(){double myNumber = 0;cout > myNumber;cout
You can write any algorithm in any way you like. Many prefer pseudocode or flowcharts, others use prose or more formalized methods. For example, if you wanted to describe an algorithm to count the number of occurrences of a given item I in a given list L, I would propose the following pseudocode: let counter be 0. let the current item C be the first item in list L. while C == valid { if C matches I then increment counter set C to the next item in the list } return counter.
write an algorithm to print the factorial of a given number and then draw the flowchart. This looks like someones homework, defiantly someone looking for the easy way. When it comes to programming, the more you do the better you get. Experience counts (making your own mistakes and learning from the mistake).
a write the algorithm to concatenate two given string
Type your answer here... i think we should first enter 1 number then check it
for($rval = $n = intval($_GET['number']); $n > 2; $n--) $rval *= $n - 1;echo $rval;
Factorials are the product of 1 and all the integers up to the given number. Simply put, 5 factorial or 5! = 5*4*3*2*1
i need a pic of cuson
kjhk
please give me an algorithm and a corresponding flow chart that displays list of numbers from 1 to 20.
double factorial(double N){double total = 1;while (N > 1){total *= N;N--;}return total; // We are returning the value in variable title total//return factorial;}int main(){double myNumber = 0;cout > myNumber;cout
answer:32 programme to print factorial of a given number in c languages
no answer....pls post
The number of diagonals in an n-sided polygon is given by nC2 - n (where n is the number of sides of the polygon) or in the expanded form: factorial (n) _______________________ {factorial (2) * factorial (n-2)} substituting (n = 6) for a hexagon we get the number of diagonals as 9. Similarly, substituting (n=5) for a pentagon we get the number of diagonals as 5.