Skip to content

Instantly share code, notes, and snippets.

@condesa
Created May 24, 2012 02:51
Show Gist options
  • Select an option

  • Save condesa/2779147 to your computer and use it in GitHub Desktop.

Select an option

Save condesa/2779147 to your computer and use it in GitHub Desktop.
Impresión de múltimos de 3 y de 5 en un rango de 1 al 100
public class PruebaFor {
public static void main(String[] args) {
for(int i=1; i<=100;i++){
if(i%3 == 0 && i%5 == 0){
System.out.println("PumasUNAM,");
}else if(i%3 == 0){
System.out.println("Pumas,");
}else if(i%5 == 0){
System.out.println("UNAM,");
}else{
System.out.println(i + ",");
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment