Tag Archives: Factorial

CPP04 – (a) Write a CPP program to print the factorial of a given number.

(a) Write a CPP program to print the factorial of a given number. CODE:- #include<iostream.h> #include<conio.h> void main() { int i,num; long fact=1; clrscr(); cout<<“Enter Number : “; cin>>num; for(i=num;i>0;i–) { fact=fact*i; } cout<<“Factorial = “<<fact<<endl; getch(); } [codesyntax lang=”cpp”] #include<iostream.h> #include<conio.h> void main() {   int i,num;   long fact=1;   clrscr();   cout<<“Enter… Read More »

Write a program in assembly language to find the factorial of any number (assume number is smaller than 10) – IGNOU MCA Assignment 2016 – 17

MASTER OF COMPUTER APPLICATIONS Course Code : MCSL-017 Course Title : C and Assembly Language Programming (Lab Course) Assignment Number : MCA(1)/L-017/Assignment/16-17 Maximum Marks : 50 Weightage : 25%   Write a program in assembly language to find the factorial of any number (assume number is smaller than 10) – IGNOU MCA Assignment 2016 – 17… Read More »

Draw a corresponding flow chart to find the factorial of a given number using recursion. 10m Dec2008

1. (a) Design an algorithm, draw a corresponding flow chart and write a program in ‘C’, to find the factorial of a given number using recursion. 10m Dec2008   Flowchart: Code: #include<stdio.h> void main() { int factorial(); int FACT,NUM; clrscr(); printf(“ENTER NUMBER : “); scanf(“%d”,&NUM); if(NUM>0) { FACT=factorial(NUM); printf(“\nFACTORIAL OF GIVEN NUMBER IS %d “,FACT);… Read More »

ASSEMBLY15 An Assembly program to find the factorial of decimal number given by user

Now we will write another Assembly program to to find the factorial of decimal number given by user Let’s identify variables needed for this program. First variable will be the one which will hold the value entered by user in the variable NUM and FACT will hold 1H and Other variable RES will be holding the Resultant Decimal equivalent printable… Read More »