Power

Easy Recursion
Solve in Playground →

Problem Statement

Write a recursive C function to calculate base A raised to the power B (A^B).

Input Format

Two space-separated integers A and B.

Output Format

Print A^B.

Constraints

-10 <= A <= 10, 0 <= B <= 15

Sample Input

2 3

Sample Output

8

Explanation

2^3 = 8 computed recursively.

Starter Code

#include <stdio.h>

long long power(long long base, int exp) {
    // Write recursive logic here
}

int main() {
    long long base;
    int exp;
    if (scanf("%lld %d", &base, &exp) == 2) {
        printf("%lldn", power(base, exp));
    }
    return 0;
}

Limits

  • Time Limit: 1s
  • Memory Limit: 256MB

Embedded C Programming

Updated: March 15, 2026
Intermediate

Embedded systems rely on efficient low-level programming to interact directly with hardware. In this course, you will learn how to write practical Embedded C programs used in real microcontroller-based systems. Rather than focusing only on theory, this course follows a practice-driven approach. Each lesson includes hands-on coding exercises that simulate real firmware development tasks used