
Problema con bucle
Publicado por Omar (14 intervenciones) el 05/11/2015 06:34:57
El problema es que cuando elijo "n" o cualquier otra letra para que repita el bucle, me hace un bucle infinito en pantalla.
Gracias por su tiempo
Gracias por su tiempo
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>
#include <stdio.h>
using namespace std;
int main()
{
int op, seguir;
do {
cout << "MENU" << endl;
cout << "1)A" <<endl;
cout << "2)B" <<endl;
cout << "elige opcion:" <<endl;
cin >>op;
switch (op){
case 1:
cout <<"A captura" <<endl;
break;
case 2:
cout <<"B muestra" <<endl;
break;
}
cout <<"deseas continuar? s/n" <<endl;
fflush(stdin);
cin >>seguir;
}while(seguir != 'n');
return 0;
}
Valora esta pregunta


0