
i need to replace this code with switch case
for(int i=0;i<100;i++){ if((i%3)==0) system.out.println("java"); if((i%5)==0) system.out.println("technology"); if((i%15)==0) system.out.println("java technology");
}
my email:mma_elsadany@yahoo.com thanks a lot

Hi Friend,
Here is your required code:
class Loops{
public static void main(String[] args){
for(int i=0;i<100;i++){
for (int j = 1; j <= i; j++)
{
if(i % j == 0){
switch(i/j){
case 3: System.out.println ("java");
break;
case 5: System.out.println ("technology");
break;
case 15: System.out.println ("java technology");
break;
}
}
}
}
}
}
Thanks
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.