Facebook
From Adjowa Asamoah, 1 Month ago, written in Plain Text.
This paste is a reply to part 1 from Adjowa Asamoah - view diff
Embed
Download Paste or View Raw
Hits: 168
  1. size(200, 200);
  2. int n = 7;
  3. int factorial = 1;
  4. for(int i = 1; i <= n; i++){  // Changed the loop condition and starting value of i
  5.   factorial = factorial * i;
  6. }
  7. textAlign(CENTER);
  8. text(factorial, 100, 100); // Removed quotes around "factorial" to display the value of factorial
  9.  
  10. save("Assignment5_part1")