fork(5) download
  1. class Ideone {
  2. public static void main (String[] args) {
  3. int f = 1;
  4. int c = 5;
  5. String s = "";
  6. while (c > 1) {
  7. f *= c;
  8. s += c + " x " ;
  9. c--;
  10. }
  11. s += c;
  12. System.out.println(s + " = " + f);
  13. }
  14. }
Success #stdin #stdout 0.04s 711168KB
stdin
Standard input is empty
stdout
5 x 4 x 3 x 2 x 1 = 120