Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main(void){
- int num1,num2,num3,num4,num5;
- int numpos=0;
- cout<< "Ingrese el primer numero: " ;
- cin>> num1;
- cout<< "Ingrese el segundo numero: " ;
- cin>> num2;
- cout<< "Ingrese el tercer numero: " ;
- cin>> num3;
- cout<< "Ingrese el cuarto numero: " ;
- cin>> num4;
- cout<< "Ingrese el quinto numero: " ;
- cin>> num5;
- if(num1>0){
- numpos++;
- }
- if(num2>0){
- numpos++;
- }
- if(num3>0){
- numpos++;
- }
- if(num4>0){
- numpos++;
- }
- if(num5>0){
- numpos++;
- }
- cout<<"La cantidad de numeros positivos es: "<<numpos;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment