Semester : S1 and S2
Subject : Computer Programming
Year : 2017
Term : DECEMBER
Branch : BIOTECHNOLOGY
Scheme : 2015 Full Time
Course Code : CS 100
Page:32
scanf("%d", ന)?
printf ("Factorial of 84 = 510", ൩, multiplyNumbers(n));
return 0;
}
recfun(5) سب
recfun(4) പ
recfun(3) لب
recfun(2) *-
recfun(1) പ
recfun(0)
The recfun() is called with arguement 5. inside the function it prints 5 and the recfun with arguement 4 is called in
which 4 is printed and recfun(3) called and so on upto recfun(0). The function recfun(0) returns without calling other
function and then recfun(1) returns and so on upto recfun(5) returns to the called function main.
Factorial of a Number using recurssion
#include
long int multiplyNumbers(int ന)?
int main()
{
int n;
printf ("Enter a positive integer: ");
long int multiplyNumbers (int ற)
{
if (n >= 1)
return n*multiplyNumbers (೧-3) ;
else
return 1;
Output
Enter a positive integer: 6
Factorial of 6 = 720
6 a Write ೩ C program 10 sort an Array using Pointer.
Sorting an array using Pointer
#include
#include
void sorting(int +>,
int y); void main()
{