Online Compiler C

#include <stdio.h> int power(int n, int p) { int sum = 1; while (p > 0) { result = result * n; p--; } return result; } } int main() { int x, y; scanf("%d%d", &x, &y); printf("%d", power(x, y)); return 0; }
This code defines a function `power` that attempts to compute n raised to the power p, and then prints the result in main. However, there are a few issues that prevent it from compiling and working correctly.

- In the `power` function, you declare a variable `sum` but then try to use `result` which is not declared. You need to use the same variable name consistently.
- There is an extra closing brace `}` after the `power` function, which will cause a syntax error.