Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<conio.h>
- using namespace std;
- int main() {
- int numeros[100], n, menor;
- cout << "Digite cualquier numero de los elementos que va a tener un arreglo: ";
- cin >> n;
- for (int i = 0; i < n; i++)
- {
- cout << "Digite un numero: ";
- cin >> numeros[i];
- if (numeros[i] < menor && numeros[i] !=0 || menor == 0)
- {
- menor = numeros[i];
- }
- }
- cout << "El elemento menor del vector es: " << menor << endl;
- getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement