Ask your own question, for FREE!
Mathematics 21 Online
OpenStudy (anonymous):

please can anyone help me with a computer science program (c++)...........Write a while loop that displays each integer from 1 to 5 together with its square and cube. Display all three values for each integer on a separate line. .

OpenStudy (anonymous):

In java: //start public class Main { public static void main (String[] args) { int ai = 1; System.out.println("num\tsquare\tcube"); while (ai < 6) { System.out.println(ai + "\t" + (ai*ai) + "\t" + (ai*ai*ai)); ai += 1; } } } //end http://ideone.com/rL1VE for link to code I'm not going to write it in c++ because then you could just copy and paste it. This isn't a difficult problem so I think reading through the java will clear up any issues you had. Even if you don't know java, it's easily digestible if you know any other language. Also, this is more computer science than math so post it in the CS section.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!