PDA

View Full Version : Name of program


nofear13
Feb 21, 2009, 06:09 AM
we have an assignment!
but hold up!
I would only ask what is the name of this code if I have fill up the blanks!
code:
puclic class problim{
public static void main(String[]arg){
int x=___;
int y=___;
while;(__<s){
x=____;
y=____;
system.out.print(_+_+_+_);
x=_+_;
}
}
}

is it a while loop or do while? Or if-else? What ? If I had fill it up?.
thanks for your time...

nofear13
Feb 21, 2009, 06:18 AM
output:
11 34 59

if you ever what to fill up the blnkz?=)

Perito
Feb 22, 2009, 01:46 PM
while;(__<s){
x=____;
y=____;
system.out.print(_+_+_+_);
x=_+_;
}


It's a while loop - the condition is evaluated before the loop starts and at the beginning of every loop. The "while;" should read "while(" (eliminate the semicolon).

nofear13
Feb 23, 2009, 01:32 AM
OK thanks for the answer!=)