| | |
loops
![]() |
•
•
Join Date: Oct 2006
Posts: 13
Reputation:
Solved Threads: 0
The solution that you were given does not seem to work if I use it, so I decided to use another method using a while loop and the instructions are as follows
int i = 97;
int j = 14;
while(j > 0)
{
System.out.println(+ i);
j--;
i = i - j;
}
This solution will definately work, try it and you will see.
int i = 97;
int j = 14;
while(j > 0)
{
System.out.println(+ i);
j--;
i = i - j;
}
This solution will definately work, try it and you will see.
•
•
Join Date: Oct 2006
Posts: 3
Reputation:
Solved Threads: 0
•
•
•
•
ok i just started loops in my java class and im stuck on getting this loop working i dunno what all math to do to get these numbers for the output
97, 84, 72, 61, 51, ... 1
class Loops
{
public static void main(String[] args)
{
for(int i=97;i>0;i--)
{
for(int j=13;j>0;j--)
{
System.out.print(i+" ");
i=i-j;
//System.out.println(j);
}
break;
}
}
}
•
•
Join Date: Oct 2006
Posts: 3
Reputation:
Solved Threads: 0
this is my ID: bommavj@gmail.com
my name is vijay if u wanna any help send me queries...
yours vijay....
my name is vijay if u wanna any help send me queries...
yours vijay....
![]() |
Similar Threads
- Program Help Using For Nested Loops (C++)
- Need Advice on for loops with vowels (Java)
- Loops (C++)
- Need some help with my do-while and while loops (Java)
- Help with loops (Java)
- merged:nesting loops (C++)
- help for program involving switch loops and file (C++)
Other Threads in the Java Forum
- Previous Thread: Java Sun Programmer 1.4 Certification Exam HELP!!!
- Next Thread: Loops
| Thread Tools | Search this Thread |
3d 6 @param affinetransform android api applet application arc array arrays automation binary bluetooth bold byte c++ chat class client code color compare component coordinates database detection doctype eclipse eclipsedevelopment educational error file fractal froglogic game givemetehcodez graphics gridlayout gui guitesting helpwithhomework html ide ideas image ingres input integer internet intersect j2me java java.xls javaexcel javaprojects jni jpanel jtextarea julia keytool keyword linux list map method methods mobile netbeans newbie nextline object pong problem producer program programming project projectideas read recursion recursive replaysolutions rim scanner sell server set size sms sort sql string swing terminal threads tree web websites windows





