Advertisement
Guest User

Untitled

a guest
Jan 19th, 2012
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.57 KB | None | 0 0
  1.  
  2. static int result=1; // you would better make spaces near equal sign, like static int result = 1;
  3. 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) {
  4.   return result; //it will return result and NEVER execute code below, it will ALWAYS return 1
  5.   int ctr=1;  // it should be 0, because you are missing one power, missing spaces
  6.   while (ctr!=y) { // you would better use for loop but it's ok, missing spaces
  7.     result = result * t;
  8.     ++ctr;
  9.   }
  10.   // here should be return result;
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement