answersLogoWhite

0


Best Answer

chutia mc,bc bhosdika

User Avatar

Wiki User

12y ago

Still curious? Ask our experts.

Chat with our AI personalities

LaoLao
The path is yours to walk; I am only here to hold up a mirror.
Chat with Lao
BlakeBlake
As your older brother, I've been where you are—maybe not exactly, but close enough.
Chat with Blake
JudyJudy
Simplicity is my specialty.
Chat with Judy

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?

Certainly! Here is a simple program in x86 assembly language to calculate the factorial of a given number: section .data number db 5 result dw 1 section .text global _start _start: mov cx, 1 mov ax, 1 calculate_factorial: cmp cx, byte[number] jg end_calculation imul ax, cx inc cx jmp calculate_factorial end_calculation: mov word[result], ax ; Add code here to display or store the result ; Exit the program mov eax, 1 xor ebx, ebx int 0x80 This program initializes the number to calculate the factorial of (in this case, 5) and then iterates through a loop to calculate the factorial using the imul instruction. The result is stored in the result variable. You would need to add code to display or store the result as needed.


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.