How do I convert "for(;n<=a;)" in C to java?
How do I convert "for(;n<=a;)" in C to java?
Page 1 of 14 Replies - 188 Views - Last Post: 14 November 2011 - 06:50 PM
Replies To: How do I convert "for(;n<=a;)" in C to java?
#2
Re: How do I convert "for(;n<=a;)" in C to java?
Posted 14 November 2011 - 05:01 PM
Why you need the for loop in that case? why not just use while instead. The for loop syntax is the same in java for the case, so you will have the same thing.
Also you can look at loop tutorials:
http://www.dreaminco.../59169-looping/
http://www.dreaminco...a-for-n00blets/
Also you can look at loop tutorials:
http://www.dreaminco.../59169-looping/
http://www.dreaminco...a-for-n00blets/
#3
Re: How do I convert "for(;n<=a;)" in C to java?
Posted 14 November 2011 - 05:44 PM
Just use
while (n <= a) {
//do stuff
}
#4
Re: How do I convert "for(;n<=a;)" in C to java?
Posted 14 November 2011 - 06:06 PM
That, um, is Java... 
However, I'd go with the while, as suggested.
However, I'd go with the while, as suggested.
#5
Re: How do I convert "for(;n<=a;)" in C to java?
Posted 14 November 2011 - 06:50 PM
for(;n<=a;)
is a valid Java statement what do I miss ?
is a valid Java statement what do I miss ?
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote





|