Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package exercicios;
- import java.util.Scanner;
- public class ex14 {
- public static void main(String[] args) {
- Scanner sc = new Scanner(System.in);
- int numero;
- int par = 0;
- int impar = 0;
- for(int i = 0; i < 10; i++){
- System.out.println("Digite o número: ");
- numero = sc.nextInt();
- if(numero % 2 == 0){
- par++;
- }else{
- impar++;
- }
- }
- System.out.println("Pares: "+par+"\n Impares: "+impar);
- }
- }
- //faça um programa que peça 10 numeros inteiros, calcule e mostre a
- //quantidade de números pares e a quantidade de números impares.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement