Question about ArcMedia JavaScript Source Code 3000 Pro (gar448) for PC

1 Answer

Factorial how i can make the program that solve the factorial problem

Posted by on

1 Answer

  • Level 2:

    An expert who has achieved level 2 by getting 100 points

    MVP:

    An expert that gotĀ 5 achievements.

    Governor:

    An expert whose answer gotĀ voted for 20 times.

    Hot-Shot:

    An expert who has answered 20 questions.

  • Expert
  • 68 Answers

Function to calculate factorial would be:

function fact(n){
if (n<=1) return 1;
return fact(n-1);
}

or nonrecursive

function factnr(n)
var f=1;
for(i=n;i>1;i--) f=f*i;
return f;
}

In both cases n must be an integer

Posted on Feb 03, 2009

Add Your Answer

Uploading: 0%

my-video-file.mp4

Complete. Click "Add" to insert your video. Add

×

Loading...
Loading...

Related Questions:

1 Answer

C programming of inventory management for a local shop


Why do you program in c or visual basic
if you can do the job with a database software access for example
and if you want your problem to be solved you must provide more info

Apr 15, 2014 | Microsoft Visual Basic 6.0 for PC

1 Answer

I need a java script code for the game snakes and ladders. please help ?


First create a program or send the program in my mail arulpandit@gmail.com and i solve it...

Jan 06, 2011 | Sun Java Programming Language (cdj-275)

1 Answer

Java not supported


perform a hard reset to your mobile phone. doing this will wipe the phone to factory status when it was placed in the box. this will wipe out all personal data, music, messages, files, numbers.

cheers.

Aug 15, 2009 | ArcMedia JavaScript Source Code 3000 Pro...

1 Answer

Writing the program in c language for finding the factorial of500


If it's an int type it's already integer without exponential for examle:
void main()
{
int num=5;
num/=2;
clrscr();
printf("%d",num);
}
so the out put is 2 and no 2.5 or:

for(int i=0; i<num; i++)

so 'i' is the integer part of num.
Rate me please, thanks.

Jul 11, 2009 | Microsoft Compilers & Programming Tools

2 Answers

Assignment problem in Operation Research through C programming


find the real root of the equation xe-1-0 correct four decimal places

Jun 01, 2009 | ACI Compilers & Programming Tools

1 Answer

Can't find my installation disk for a Lexmark PrinTrio Photo


Sydney to solve your problem i need more information ok,  so what is the make and model of your PC and what operating system are you using ? what is the make and model of the printer.

May 07, 2008 | Compilers & Programming Tools

2 Answers

C++ programs


An array is a series of elements of the same type placed in contiguous memory locations that can be individually referenced by adding an index to a unique identifier
Initializing arrays. When declaring a regular array of local scope (within a function, for example), if we do not specify otherwise, its elements will not be initialized to any value by default, so their content will be undetermined until we store some value in them. The elements of global and static arrays, on the other hand, are automatically initialized with their default values, which for all fundamental types this means they are filled with zeros
include <iostream>
using namespace std;

int billy [] = {16, 2, 77, 40, 12071};
int n, result=0;

int main ()
{
for ( n=0 ; n<5 ; n++ )
{
result += billy[n];
}
cout << result;
return 0;
}
multidimensional array pseudo-multidimensional array #define WIDTH 5 #define HEIGHT 3 int jimmy [HEIGHT][WIDTH]; int n,m; int main () { for (n=0;n<HEIGHT;n++) for (m=0;m<WIDTH;m++) { jimmy[n][m]=(n+1)*(m+1); } return 0; } #define WIDTH 5 #define HEIGHT 3 int jimmy [HEIGHT * WIDTH]; int n,m; int main () { for (n=0;n<HEIGHT;n++) for (m=0;m<WIDTH;m++) { jimmy[n*WIDTH+m]=(n+1)*(m+1); } return 0; }
and now for trignometry
#include<iostream>
#include<cmath>
using namespace std;

int main()
{
int factorial(int);
int n = 3, i = 1;
double x, x2, b, PI, r;
char choice;
//r = x * (PI / 180)

cout<<"Please enter an angle value => ";
cin>>x;
cout<<"Is the angle value in Degree or Radian?"<<endl;
cout<<"Type D if its in degree "<<endl;
cout<<"Type R if its in radian "<<endl;
cin>>choice;


if((choice = 'R')||(choice = 'r'))
do{
i++; n = 3; x2 = 0; b = x2;
{
if(i == 1)
x2 = x - (pow(x,n) /factorial(n));
n = n + 2;
};
else
{
x2 = (x2 + ((pow(x,n)) /(factorial(n))) - (pow(x,n+2)) / (factorial(n+2)));
n = n + 4;
}


}while(abs(b - x2) > 0.000001);
else
//convert it to r

r = x * PI /180;

//cout<<"error occured/n";
cout<<"sin(x) = "<<x2<<endl;

return 0;
}

Mar 24, 2008 | ArcMedia JavaScript Source Code 3000 Pro...

Not finding what you are looking for?
ArcMedia JavaScript Source Code 3000 Pro (gar448) for PC Logo

Related Topics:

104 people viewed this question

Ask a Question

Usually answered in minutes!

Top ArcMedia Compilers & Programming Tools Experts

Robin Hill
Robin Hill

Level 3 Expert

1251 Answers

Michael Thomas
Michael Thomas

Level 3 Expert

3051 Answers

Mike

Level 3 Expert

4331 Answers

Are you an ArcMedia Compiler and Programming Tool Expert? Answer questions, earn points and help others

Answer questions

Manuals & User Guides

Loading...