Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*3. Crie um algoritmo que leia uma matriz de dimensão 3 x 3 e apresente na tela a quantidade de elementos
- pares desta matriz.*/
- #include <stdio.h>
- #include <stdlib.h>
- #define tam 3
- main()
- {
- int i,j,mata[tam][tam],par=0;
- for (i = 0; i < tam; i++)
- {
- for (j = 0; j < tam; j++)
- {
- printf("Informe o numero: ");
- scanf("%i", &mata[i][j]);
- if (mata[i][j] % 2 == 0)
- {
- par++;
- }
- }
- }
- printf("Numeros pares: %i\n",par);
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement