/* Determinar si un numero es multiplo de 3 y 5 */
package ejerciciosdeC;
import java.util.Scanner;
public class problema1 {
public static void main(String[] args) {
Scanner dato = new Scanner(System.in);
int n;
System.out.println("ingresa un numero: ");
n = dato.nextInt();
if(n%3==0){
if(n%5==0){
System.out.println("es multiplo de 3 y 5");
}
else{
System.out.println("no es multiplo de 3 y 5");
}
}
else{
System.out.println("no es multiplo de 3 y 5");
}
}
}
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.