Professional Documents
Culture Documents
Step 6: Finish
4. Steps for experiment/practical/Code:
#include <iostream>
using namespace std;
int power(int x, unsigned int y)
{
int temp;
if( y == 0)
return 1;
temp = power(x, y / 2);
if (y % 2 == 0)
return temp * temp;
else
return x * temp * temp;
}
int main(){
int num;
int a = 4;
int b = 3;
num = power(a,b);
cout<<"KARTIK GULERIA\n";
cout<<"19BCS2241\n";
cout<<a<<" raise to the Power "<<b<<" is "<<num;
}
6. Result/Output/Writing Summary: