public class EightHellos {
public static void main(String[] args) {
System.out.println("1st Hello");
System.out.println("2nd Hello");
System.out.println("3rd Hello");
int i = 4;
while (i <=
{
System.out.println(i + "th Hello");
i = i + 1;
}
}
}
/*************************************************************************
* Execution: java EightHellos
*
* Print your nth hello for n = 1 to 8. using a loop.
*
* % java EightHellos
* 1st Hello
* 2nd Hello
* 3rd Hello
* 4th Hello
* 5th Hello
* 6th Hello
* 7th Hello
* 8th Hello
*
*************************************************************************/
Not Satisfied ? Just search & get the result
Related posts:
