#include<iostream.h>
#include<conio.h>
int main()
{
int power(int, int);
int n, p, result;
clrscr();
cout<<"Enter the number : ";
cin>>n;
cout<<"Enter the power : ";
cin>>p;
result=power(n,p);
cout<<" The result of "<<n<<" to power "<<p<<" is "<<result;
getch();
return 0;
}
int power(int x, int y)
{
static int r=1;
if(y==0)
{
return 1;
}
else
{
r=r*x;
power(x, y-1);
}
return r;
}
Home       |      About Us       |     Portfolio       |      Services       |       Career        |    Contact Us       |      Industrial Training        |      Achievement 
Corporate Services
  Web Design and development
  Web Promotion (SEO)
  Multimedia/CD Presentation
  Software development

  E.Commerce

Training@balujalabs

  Software Courses
  Hardware Courses
  Networking.Courses
  Mobile Repairing Courses
  UGC Degrees
Student Corner
 Programming & Projects
 Placement Papers
 Project Ideas
 Synopsis Ideas

  Franchise Section

 Administrator
Franchise Inquiry
 
 

To input a number and calculate power for that number using recursion.

 

 

 

 

 

 

 

 

 

                                                                                                                                          

1 To display any text using functions.
2 Program with use defined function cube that calculate cube of the integer.
3 To demonstrate the way of declaring and using functions with no arguments.
4 To find largest of two numbers suing functions.
5 To find largest of two numbers using functions having arguments with return values.
6 To find factorial of a given number using functions.
7 To illustrate how automatic variables work.
8 To display the number and its square from 1 to 5 using register variables.,
9 To illustrate the properties of external variable.
10 To illustrate the properties of static variables.
11 Program to show how to invoke a function using an array declaration.
12 To sort and display the external array using functions.
13 To find factorial of numbers up to n.
14 To generate Fibonacci series using recursion.
15 To find square of a number using functions.
16 To swap two numbers using call by value method and display the numbers before, during and after the function calling.
17 To swap two numbers using call by reference method and display the numbers before, during and after the function calling.
18 To find the circumference of a circler using macros.
19 To calculate the cube of the given number using macro with argument technique.
20 Program on mathematical library functions.
21 To find sum of three numbers suing functions.
22 Write a recursive function to determine the sum of itegers 1, 2, 3 …+n that is recursively computed.
23 Program to differentiate between call by value and call by value and call by reference method using a function to find square root of a given numbers.
24 Program to apply various arithmetic functions on two operands using functions.
25 Program to find first n multiples of a number using recursion.
26 To calculate the binary coefficient of two numbers which can be calculated as n!/(n-r)!r!
27 What will be the output of the following program segment.
28 To input a number and calculate power for that number using recursion.
29 To generate a series of prime numbers upon n, where n being entered by user.
30 To generate a table of a number entered by user.
31 To find greatest common division between two numbers.
32 To illustrate the properties of a static variable.
33 Program on automatic and static variables.

 

     
Home       |      About Us       |     Portfolio       |      Services       |       Career        |    Contact Us       |      Industrial Training        |      Achievement