1060 - Positive Numbers

Problem Link


A Solution in c



#include<stdio.h>
int main()
{
    int i, n = 0;
    float a;
    for(i = 1; i <= 6; i++)
    {
        scanf("%f", &a);
        if(a >= 0)n++;
    }
    printf("%d valores positivos\n", n);
    return 0;
}





No comments

Theme images by Jason Morrow. Powered by Blogger.