Use while loop to calculate 2 to the power of 3 : While : Statement Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » Statement » While »

 

Use while loop to calculate 2 to the power of 3


 


package{
  import flash.display.Sprite;
  
  public class Main extends Sprite{
    public function Main(){


        var total = 2;
        var counter = 0;
        
        while (counter < 2) {
          total = total * 2;
          counter = counter + 1;
        }
    }
  }
}

        



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


Flash / Flex / ActionScript examples

 Navioo Statement
» While