0
How to display out?
Output: 1 2 3 hoo 4 5 haa 6 hoo 7haz 8 9 hoo 10 haa 11 12 hoo 13 14haz . . .until 50 https://code.sololearn.com/ciS55K43EsGq/?ref=app
7 Answers
+ 2
https://code.sololearn.com/cPGVE7Zmc2r5/?ref=app
+ 4
public class Labpractical1 {
public static void main(String args[]) {
for (int i=1; i<=50; i++) {
if (i%3==0)
System.out.println(i+" hoo");
else if (i%5==0)
System.out.println(i +" haa");
else if (i%7==0)
System.out.println(i +" haz");
else
System.out.println(i);
}
}
}
//Are you expecting this?
+ 3
Are you expecting 15 hoo haa?
0
Yes but
15 hoo haa
0
Yes
0
Create an application that loops from 1 to 50 and prints out each value on a separate line, except print out âhooâ for every multiple of 3, âhaaâ for every multiple of 5, and âhazâ for every multiple of 7.
0
Thank you đ„°