-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathc_cpp_27.cpp
More file actions
34 lines (25 loc) · 771 Bytes
/
Copy pathc_cpp_27.cpp
File metadata and controls
34 lines (25 loc) · 771 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <iostream>
using namespace std;
/*This code have a problem with the "coredump", its a problem with the segmentation of the "arreglo", consider check then*/
/*The possible solution can be the declaration of the array*/
int main()
{
int arreglo[5];
int guardar;
for (int i = 0; i <= 4; i++){
cout << "Ingrese un número: " ;
cin >> arreglo[i];
}
// for (int i = 0; i < 4; i++){
// for (int j = 0; i < 4; j++) {
// if (arreglo[j] > arreglo[j + 1]) {
// guardar = arreglo[j];
// arreglo[j] = arreglo[j + 1];
// arreglo[j + 1] = guardar;
// }
// }
// }
for (int i = 0; i < 5; i++){
cout << arreglo[i]<<endl;
}
}