answersLogoWhite

0


Best Answer

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

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Program in assembly language for factorial of a given number?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

An assembly language program that will take three decimal input and display minimum of them?

program that take three decimal number as input and find the largest among them in assembly language


Could you write a assembly language program in tasm To check whether a given number present in a sequence of given memory location containing the string to be checked in 8086?

8086 assembly language program to check wether given number is perfect or not


Program to count the number of numbers in an array using 8085 microprocessor?

A program which is used to count the number of numbers in an array using a 8085 microprocessor is known as a assembly language program.


Program for finding the factorial of the two given number using constructor?

kjhk


Write a program using while loop?

//program to find the factorial value f any number using while loop #include<stdio.h> void main() { int i,n,fact=1; printf("Enter the number\n"); scanf("%d",&n); i=n; while (i>=1) { fact=fact*i; i--; } printf("The factorial value=%d",fact); } the above is a program for calculating tha factorial value of any number which is entered by the user


What is a program in c to calculate factorial of number?

First of all we will define what factorial is and how to it is calculated.Factional is non negative integer. Notation would be n! It is calculated by multiplying all integers from 1 to n;For example:5! = 1 x 2 x 3 x 4 x 5 = 120.Note: 0! = 1Small C program that illustrates how factorial might be counted:#include int factorial(int num);int main() {int num;printf("Enter number: ");scanf("%d", &num);printf("Factorial: %d\n", factorial(num));return 0;}int factorial(int num) {if (num == 0) {return 1;}return num * factorial(num - 1);}Testing:Enter number: 5Factorial: 120Enter number: 0Factorial: 1


Write a program using 8086 instructions to double a number?

There isn't a reason to write a complete program to do this; in any assembly language just shift the value 1 bit to the left to double it.


7 Write a C program to compute the factorial of a number using for loop?

int factorial(int n) { int i; int f=1; for(i=2;i<=n;++i) f*=i; return f; }


Program to find the factorial of a number using recursion?

/*program to find the factorial of a given number*/ #include<stdio.h> #include<conio.h> int fact(int); void main() { int n,c; printf("\n enter the number for which you want to find the factorial"); scanf("%d",&n); c=fact(n); printf("\n the factorial of the number %d is %d",n,fact); getch(); } int fact(int n) { int k; if(n==0) return(1); else k=n*fact(n-1); return(k); }


Factorial number's summation's program upto n numbers in c language?

#include#includeint a,f,n,sum=0; printf("Enter any number"); scanf("%d",&n); f=1; for(a=1;a<=n;a ); { f=f*a; } for(f=1;f<=n;f ); { sum=sum f; } printf("sumation of factorial numbers :",sum); getch(); }


Write an assembly language program to multiply an 8-bit signed number by a 8-bit signed number?

MVI A, 30h MVI B 20h MUL A,B OUT port1 HLT


Write a recursive procedure to compute the factorial of a number?

#include <iostream> using namespace std; int main() { int i, number=0, factorial=1; // User input must be an integer number between 1 and 10 while(number<1 number>10) { cout << "Enter integer number (1-10) = "; cin >> number; } // Calculate the factorial with a FOR loop for(i=1; i<=number; i++) { factorial = factorial*i; } // Output result cout << "Factorial = " << factorial << endl;