Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- using namespace std;
- int main(){
- const int tam = 5;
- int vNum[tam];
- int i, num, numNew;
- for (i = 0; i < tam; i++){
- cout<<"ingrese un numero: ";
- cin>>num;
- vNum[i]=num;
- }
- cout<<"ingrese un numero nuevo: ";
- cin>>numNew;
- for (i = 0; i < tam; i++){
- if (vNum[i]==numNew){
- cout<<"el numero ingresado pertenece a la lista anterior";
- }
- }
- cout<<endl;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment