Input
The input will be 5 integer values.
Output
Print a message like the following example with all letters in lowercase, indicating how many even numbers were typed.
Input Sample | Output Sample |
7
-5 6 -4 12 |
3 valores pares
|
Solution using C :
#include <stdio.h>
int main() {
int i,n[5],c=0;
for(i=0; i<5; i++)
{
scanf("%d",&n[i]);
if(n[i]%2==0)
{
c++;
}
}
printf("%d valores pares\n",c);
return 0;
}
Comments
Post a Comment