Accepted solution

URI 1066 solution

Open original problem
Source code

#include <stdio.h>

int main()

 {

     int array[5];

    int i,even=0,odd=0,poss=0,neg=0;

     for(i=0; i<5; i++)

    {

        scanf("%d",&array[i]);

        if(array[i]%2==0)even++;

        if(array[i]%2!=0)odd++;

        if(array[i]>0)poss++;

        if(array[i]<0)neg++;

    }

    printf("%d valor(es) par(es)
",even);

    printf("%d valor(es) impar(es)
",odd);

    printf("%d valor(es) positivo(s)
",poss);

    printf("%d valor(es) negativo(s)
",neg);

    return 0;

}
Join the discussion

Add your comment