R_FACTOR - fac=rec(no) ;...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
// FACTORIAL BY RECURSION// / #include<stdio.h> #include<conio.h> # long int rec(int) ; void main(void) { int no; long int fac; clrscr(); printf("enter the number for factorial : "); scanf("%d",&no);
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: fac=rec(no) ; printf(&quot;factorial=%ld&quot;,fac); getch(); } long int rec(int no) { long int fac; if (no==1 || no==0) return (1); r else fac=no*rec(no-1) ; return (fac) ; r }...
View Full Document

This note was uploaded on 11/06/2010 for the course UBIT 411 taught by Professor Saleemelahi during the Spring '10 term at University of Karachi.

Ask a homework question - tutors are online