Que error tengo en mi codigo
Publicado por Aldair (2 intervenciones) el 15/03/2021 05:34:26
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#include <iostream>
using namespace std;
int main () {
int pos, n, a=0, b=1, c;
cout<<" ingrese la opcion deseada.\n "<<endl;
cout<<" 1-. FACTORIAL"<<endl;
cout<<" 2-. FIBONACI"<<endl;
cout<<" 3-. SALIR"<<endl;
cin>> pos;
system("cls");
switch (pos) {
case 1:
int n=e, i=2, f=1;
cout<<"Ingresar el mumero: "<<end1;
scanf ("%d", &n)
do {
f=f*i;
i++;
} while (i<=n);
cout<<"El factorial es: "<<f<<end1
}
break;
case 2:
cout<<"\n FIBONACI \n"<<endl;
cout<<"Ingrese el valor maximo: ";
cin>>n;
cout<<"FIBONACCI: "<<endl;
cout<<a<<endl;
while (b<n)
{cout<<b<<endl;
c=a+b;
a=b;
b=c;
}
return 0;
break;
case 3:
cout<<"\n SALIR \n"<<endl;
break;
}
return 0;
}
Valora esta pregunta


0