Answers for "How many positive number from 1 to 6 variables?"

0

How many positive number from 1 to 6 variables?

#include <iostream>
using namespace std;
int main() {
    double a;
    int x = 1;
    int y = 0;
    while(x<=6){
        x+=1;
        cin>>a;
        if(a>0){
            y+=1;
        }
    }
    cout<<y<<" valores positivos"<< endl;
    return 0;
}
Posted by: Guest on March-31-2022

Code answers related to "How many positive number from 1 to 6 variables?"

Browse Popular Code Answers by Language