Find Us On: Facebook Twitter Rss Feed Blog
Need To Register? Sign Up Login

Simple Java question 4

BunkerHillBroad
BunkerHillBroad 


For each call below to the mystery method, write the output that is produced, as it would appear on the console: public static void mystery (int x, int y) { int s = 0; while (x > 0 && 2 * y >= x) { System.out.print(s + " "); y = y - x; x--; s = s + x; } System.out.println (s); } A. mystery(-2, -6); B. mystery(2, 3); C. mystery(4, 8); D. mystery(10, 31); Attachments
Tags Clarifications

Answers

Simple Java question 4 - Solution

mariobeka
mariobeka 



Open the solution file with any text editor. Attachments Screenshots
Purchase Answer