Advertisement
AleOlivera

TP4

Apr 19th, 2022
1,316
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.25 KB | None | 0 0
  1. Public Sub Using_IF()
  2.  
  3. {
  4.  
  5. //establecer positivos negativos y cerosInt x, i, pos=0, neg=0, cero=0;
  6. for(I=0;I<5;I++)
  7. {
  8. cout<<"Ingrese un numero";
  9. cin>>X;
  10. if (X==0)
  11. cero++;
  12. else if (X<1)
  13. neg++;
  14. else
  15. pos++;
  16. }
  17. cout<<pos;
  18. cout<<neg
  19. cout<<cero;
  20.  
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement