Generation

generate functionFri, 28 Apr 2023

escriba un programa que calcule x^y, donde tanto x como y son enteros positivos, sin utilizar la función pow.

int power(int x, int y) { if( y == 0) return 1; else if (y%2 == 0) return power(x, y/2)*power(x, y/2); else return x*power(x, y/2)*power(x, y/2); }

Want to kickstart your project?Use the new AI Studio to create your code