Monday, January 5, 2009

Write an assembly language program in C program to- find out factorial of given number?

Answer:

void main()

{

int num;

clrscr();

scanf("%d",&num);

asm mov ax,1;

asm mov bx,1;

asm mov cx,num;

come:

asm mul bx;

asm inc bx;

asm dec cx;

asm jnz come;

printf("%d ",_AX);

getch();

}

No comments:

Blog List