Online Compiler C

#include <stdio.h> int power(int n, int p) { int result = 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 computes n raised to the power p using repeated multiplication, then reads two integers and prints the result. There is a syntax error: an extra closing brace `}` after the `power` function.

- The extra `}` on line 10 is unmatched and will cause a compilation error. Check the braces around the `power` function body.
- The `power` function does not handle the case when p is negative, which could lead to incorrect behavior if a negative exponent is entered.