plz help me with this program.....i would be highly...obliged if i'm helped
Plz help me with this program....its real urgent/.////..plz....plz
1
4 9
16 25 36
49 64 81 100
Re: plz help me with this program.....i would be highly...obliged if i'm helped
Help you with what program? What kind of an answer do you expect to get from this?
You need to give a better description of your problem and what you are trying to achieve.
Re: plz help me with this program.....i would be highly...obliged if i'm helped
Code Java:
public class WhatIsYourQuestion {
public static void main(String[] args) {
System.out.println("1");
System.out.println("4 9");
System.out.println("16 25 36");
System.out.println("49 64 81 100");
}
}
Re: plz help me with this program.....i would be highly...obliged if i'm helped
I think he is asking us to find a relation with those numbers and to print those numbers using a nested for loop.
=)
Re: plz help me with this program.....i would be highly...obliged if i'm helped
Quote:
Originally Posted by
IAmHere
I think he is asking us to find a relation with those numbers and to print those numbers using a nested for loop.
=)
You can't leave things open to interpretation when you want quality replies. Thread starters need to write a clear, descriptive question. This is the kind of thread that gets left unanswered. People who want to help don't have time to chase clarification.
Re: plz help me with this program.....i would be highly...obliged if i'm helped
Quote:
Originally Posted by
IAmHere
I think he is asking us to find a relation with those numbers and to print those numbers using a nested for loop.
=)
...
Code Java:
for (int i = 1; i < 11; i++) {
int temp = i*i;
System.out.println(temp);
}
Re: plz help me with this program.....i would be highly...obliged if i'm helped
What is the posted code supposed to do? Comments are useful here.
How is it related to the OPs question?
Re: plz help me with this program.....i would be highly...obliged if i'm helped
Quote:
Originally Posted by
Norm
What is the posted code supposed to do? Comments are useful here.
How is it related to the OPs question?
Question: 1 4 9 16 25 36 49 64 81 100
My answer:
Code Java:
for (int i = 1; i < 11; i++) {
int temp = i*i;
System.out.println(temp);
}
Comments:
1x1 = 1
2x2 = 4
3x3 = 9
4x4 = 16
5x5 = 25
6x6 = 36
7x7 = 49
8x8 = 64
9x9 = 81
10x10 = 100
for i = 1..10 print i*i
Re: plz help me with this program.....i would be highly...obliged if i'm helped
How is it related to the OPs question?
Code :
// Print out the squares of 1 to 10, one on each line
for (int i = 1; i < 11; i++) {
System.out.println(i*i);
}