SHARE
TWEET

Untitled

a guest Jul 22nd, 2019 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* Syntax */
  2. while (expression) {
  3.    // Statement(s) to be executed if expression is true  
  4. }
  5. /* Example */
  6. var num = 6;
  7. var factorial = 1;
  8.    
  9. while(num >=1) {
  10.    factorial = factorial * num;
  11.    num--;
  12. }
  13. print("The factorial  is ${factorial}");
  14.  
  15. /* Output
  16.     The factorial is 720
  17.  */
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top