hey guys , I don't understand why the outPUT is that for the code below.. can someone please explin me how it works. Thank you. class example{ public static void main (String[]args){ int i = 1,j; while (i<=3){ j=i; while(j<=4){ System.out.println(j+" "+i); j=j+2; } i=i+1; } } } HERE IS THE OUTPUT 1 1 3 1 2 2 4 2 3 3 +0 I wrote this code for an assignment that asked to create a program that calculates and displays the average of any amount of real numbers. The program is supposed to ask the user how many numbers they want to enter and then use a loop to ask the user to enter a number, keeping track of the sum as they are entered, and then calculating the average. I have it somewhat ok, until the end where it's supposed to give the average. I tried a couple things but none of them gave me the right answer. I don't think I'm … +0 I'm writing some while loops but I feel like there is a better way to write them. [CODE]int i=3; while (i<31) { cout << i << " "; i+=3; } //this one is for the first 10 terms of a sequence starting with 3 and adding 3 each time. int i=2; while (i<50000) { cout << i << " "; i*=2; } //this one is the first 15 terms starting at 2 and doubling each one.[/CODE] Is there some way to let the program know how many variables to show without figuring out how far it has to go? Also, … +0 im trying to make a simple calculator: [CODE] loop = 1 while loop == 1: print "Welcome to Jakes' Calculator" print "1) addition" print "3) multiplication" choice = raw_input("Enter a number 1-4: ") break if choice.strip() == "1": a = input("enter the first number: ") b = input("enter the second number: ") c = a + b print a, "plus", b, "equals", c elif choice.strip() == "3": a = input("enter the first number: ") b = input("enter the second number: ") c = a * b print a, "times", b, "equals", c elif choice.strip() != "1" "3" : print "Not … +0 Hi, I have a While Loop to display my MySQL info. This makes a list of all my data, in one row. But what I want is it to display it in a table with 5 columns so that the data is more readable. this is my code: [CODE] while (\$row = mysql_fetch_array(\$retd)) { \$code = \$row["code"]; \$name = \$row["name"]; echo("
"); echo (""); echo ("
\$name"); echo("