Solution of URI 1065::Even Between five Numbers
Before seeing the solution make sure that you have tried enough. Don’t copy the whole code, just find out the logic. If you feel any problem, you will inform me by comment.
#include <stdio.h>
int main()
{
int n[5],i,count=0;
for(i=0;i<5;i++) {
scanf("%d",&n[i]);
}
for(i=0;i<5;i++) {
if (n[i]%2==0) {
count++;
}
}
printf("%d valores pares\n",count);
return 0;
}
No comments