Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static int result=1; // you would better make spaces near equal sign, like static int result = 1;
- static int a(int t,int y) // you would better give sensible names to variables and again make spaces like static int a(int t, int y) {
- return result; //it will return result and NEVER execute code below, it will ALWAYS return 1
- int ctr=1; // it should be 0, because you are missing one power, missing spaces
- while (ctr!=y) { // you would better use for loop but it's ok, missing spaces
- result = result * t;
- ++ctr;
- }
- // here should be return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement