answersLogoWhite

0


Best Answer

chutia mc,bc bhosdika

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: By using call by reference find the factorial of a number?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What does an exclamation mark mean in equations?

lets say the equation says 5! that means 5x4x3x2x1 which equals 120 it is call five factorial based on what number is put in front of it it could be six factorial, seven factorial, etc..


Call by reference using pointer in c plus plus?

Example: void foo( MyClass& object ){} // function with call by reference signature MyClass* p = new MyClass(); // instantiate a pointer to MyClass foo( *p ); // call by reference using the pointer


Can you swap two numbers by call by reference outside the function?

The using of term 'call-by-reference' implies function-call, so please rethink your question...


What is the benefit of using function.llustrate different ways of passing argument to function in c plus plus?

Functions are used to reduce the lines of code and the complexity of the code. For an instance let us suppose that you want to calculate the factorial of numbers at different times in a program. There are two ways to do this 1. Write a 4-5 line code every time you want to calculate factorial. 2. Write a function of 4-5 lines which calculates the factorial and call that function every time you need to calculate factorial by just writing a single line. In C++ you can pass the variable, address of the variable or a reference to the variable in a function


Write a C-like program fragment that calculate the factorial function for argment 12 with do while loop?

#!/usr/bin/perl print factorial($ARGV[11]); sub factorial { my($num) = @_; if($num == 1) { return 1; # stop at 1, factorial doesn't multiply times zero } else { return $num * factorial($num - 1); # call factorial function recursively } }


What does ref means after the call number mean in card catalog?

it means reference number From my iPad


Program in assembly language for factorial of a given number?

INCLUDE Irvine32.inc .data num DWORD ? fact DWORD 1 str1 DB "Enter a number to Calculate Factorial: ",0 str2 DB "The Factorial is: ",0 .code main PROC call clrscr mov edx,OFFSET str1 call WriteString call ReadDec mov num,eax mov ecx,num L1 : mov eax,ecx mov ebx,fact mul ebx mov fact,ebx LOOP L1 mov edx,OFFSET str2 call WriteString mov eax,fact call WriteDec exit main ENDP END main


What is the meaning of letter R above the call number of the book?

Reference Books


What is the meaning of letter R above a call number of a book?

Reference Books


What is a recursive function?

A recursive function is one that calls upon itself until a given result in the original call is met. Take a look at this example. Program Recursion; Uses crt; Var number:longint; Function Factorial(number:longint):longint; Begin if number > 0 then factorial:=number*factorial(number-1) else factorial:=1; End; Begin clrscr; readln(number); writeln(factorial(number)); readln; End. Note how the function factorial calls itself.


Swap two numbers using call by value and call by reference?

You cannot swap two numbers using call by value, because the called function does not have access to the original copy of the numbers.Swap with call by reference... This routine uses exclusive or swap without temporary variable.void swap (int *a, int *b) {*a ^= *b;*b ^= *a;*a ^= *b;return;}


What is the meaning of letter R above the call number of a book?

The letter R above a call number of a book typically indicates that the book is part of the Reference section in a library. Reference books are usually non-circulating and are meant to be used within the library for quick access to information.