by CodeChum Admin
There are different kinds of numbers, but among them all, the most commonly used numbers in our daily lives are those positive ones. So, I only want you to count all the positive numbers from the 4 outputted values and print out the result.
Go and search for the positive ones among these four!
#include <iostream>
using namespace std;
int main()
{
int a,b,c,d;
cout<<"Enter a Number: ";
cin>>a;
cout<<"Enter a Number: ";
cin>>b;
cout<<"Enter a Number: ";
cin>>c;
cout<<"Enter a Number: ";
cin>>d;
if (a > 0)
{
cout<<a<<endl;
}
if (b > 0)
{
cout<<b<<endl;
}
if (c > 0)
{
cout<<c<<endl;
}
if (d > 0)
{
cout<<d<<endl;
}
}
Comments
Leave a comment