Hey! What's wrong with this c++ code?

#include <iostream>

using namespace std;

int f(int x, long int y) {

if (y==0){

return 1;

}

if(y%2==0){

return f(x,y/2)**2 % 41;

}

if (y%2==1){

return x*f(x,y/2)**2 % 41;

Read more… (52 words)

Active In

Competitive Programming

Indian Computing Olympiad (ICO)

International Olympiad in Informatics

Featured Contributions

comment in this discussion

Hey! What's wrong with this c++ code?

#include <iostream>

using namespace std;

int f(int x, long int y) {

if (y==0){

return 1;

}

if(y%2==0){

return f(x,y/2)**2 % 41;

}

if (y%2==1){

return x*f(x,y/2)**2 % 41;

Read more… (52 words)