#include <iostream>
int main()
{
int x, n, result = 1;
std::cout << "Enter x: ";
std::cin >> x;
std::cout << "Enter n: ";
std::cin >> n;
while (n > 0)
result *= x;
n--;
}
std::cout << "Power x of n: " << result << std::endl;
return 0;
#include <iostream>
int main()
{
int x, n, result = 1;
std::cout << "Enter x: ";
std::cin >> x;
std::cout << "Enter n: ";
std::cin >> n;
while (n > 0)
{
result *= x;
n--;
}
std::cout << "Power x of n: " << result << std::endl;
return 0;
}