YAMILDIAZ

ejercicio 1

Jun 14th, 2023
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.37 KB | Source Code | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3. using namespace std;
  4.  
  5.  
  6. int main(){
  7. const int tam = 10;
  8. int vEntero[tam];
  9. int i, num;
  10.  
  11. for (i = 0; i < tam; i++){
  12.     cout<<"ingresar un num: ";
  13.     cin>>num;
  14.     vEntero[i] = num;
  15. }
  16.  
  17. for (i = 0; i < tam; i++){
  18.     if (vEntero[i]>0){
  19.             cout<<"\t"<<vEntero[i];
  20.     }
  21. }
  22.  
  23.  
  24. cout<<endl;
  25. system("pause");
  26. return 0;
Advertisement
Add Comment
Please, Sign In to add comment