geeksforgeeks
  • Courses
  • Tutorials
  • Practice
  • Jobs
  • DSA
  • Practice Problems
  • C
  • C++
  • Java
  • Python
  • JavaScript
  • Data Science
  • Machine Learning
  • Courses
  • Linux
  • DevOps
Videos
July 07, 2022 |900 Views

Calculate power (x,y) using recursion

Maths, recursion, divide-and-conquer, Divide and Conquer
 Save  Share   Like
Description
Discussion

Given two integers x and n, write a function to compute xn. We may assume that x and n are small and overflow doesn’t happen.
Input : x = 2, n = 3
Output : 8

Input : x = 7, n = 2
Output : 49


Calculate power (x,y) using recursion : https://www.geeksforgeeks.org/write-a-c-program-to-calculate-powxn/

Recommendations
Video Thumbnail
08:31
Video Thumbnail
65.3K Views | 31/07/2024...
Tower of Hanoi
Video Thumbnail
14:57
Video Thumbnail
12.9K Views | 04/07/2022...
Find the missing element in the Arithmetic Progression
Video Thumbnail
09:13
Video Thumbnail
1.4K Views | 04/07/2022...
Median of two sorted arrays of same size
Video Thumbnail
08:44
Video Thumbnail
92.0K Views | 28/06/2022...
Closest Pair of Points
Video Thumbnail
04:37
Video Thumbnail
132.2K Views | 28/06/2022...
Strassen’s Matrix Multiplication
Video Thumbnail
05:04
Video Thumbnail
10.1K Views | 13/06/2022...
Power without using multiplication(*) and division(/) operators
GeeksforGeeks
location
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
location
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play StoreGFG App on App Store
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • Careers
  • Contact Us
  • Corporate Solution
  • Campus Training Program
  • Explore
  • POTD
  • Practice Problems
  • Connect
  • Blogs
  • Upskill Courses
  • Tutorials
  • Programming Languages
  • DSA
  • Web Technology
  • AI, ML & Data Science
  • DevOps
  • CS Core Subjects
  • GATE
  • School Subjects
  • Software and Tools
  • Courses
  • ML and Data Science
  • DSA and Placements
  • Web Development
  • Data Science
  • Programming Languages
  • DevOps & Cloud
  • GATE
  • MongoDB Certifications
  • Offline Centers
  • Noida
  • Bengaluru
  • Hyderabad
  • Kolkata
  • Preparation Corner
  • Interview Corner
  • Aptitude
  • Puzzles
  • GfG 160
  • System Design
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved