imprimir
x=input('Ingrese un valor de x = ');
if x>=10
while x>=50
x=x-5;
end
else
if x5
y=x
else
y=0
end
z=x+y
end
z(ESCRIBIR EL NOMBRE DEL EJERCICIO)
ingrese el valor de z=5
ingrese el valor de x=6
x = 11
y = 11
z = 22
x = 16
y = 16
z = 32
x = 21
y = 21
z = 42
x = 26
y = 26
z = 52
z = 52
3.-PROBLEMA 23
disp('solucion de ax^2+bx+c=0');
a=input('Ingrese el valor de a = ');
b=input('Ingrese el valor de b = ');
c=input('Ingrese el valor de c = ');
d=b^2-4*a*c;
if d>=0
if d>0disp('raices reales son');
x1=(-b-sqrt(d))/(2*a)
x2=(-b+sqrt(d))/(2*a)
else
disp('raiz unica');
x=(-b)/(2*a)
end
else
disp('raicescomplejas');
x1=(-b-sqrt(d))/(2*a)
x2=(-b+sqrt(d))/(2*a)
end
(ESCRIBIR EL NOMBRE DEL EJERCICIO)
solucion de ax^2+bx+c=0
Ingrese el valor de a = 2
Ingrese el valor de b = 1
Ingrese el valorde c = 4
raices complejas
x1 = -0.2500 - 1.3919i
x2 = -0.2500 + 1.3919i
4.- PROBLEMA 24
x=input('Ingrese el valor de x= ');
n=input('Ingrese el valor de n= ');
x1=[];
x2=[];
x3=[];for i=0:n-1
x1(i+1)=coseno(x,i);
x2(i+1)=cos(x);
x3(i+1)=abs(x1(i+1)-x2(i+1))/x2(i+1);
end
disp(' aproxi cos(x) error');
disp([x1(n) x2(n) x3(n)]);
(ESCRIBIR EL NOMBREDEL EJERCICIO)
Ingrese el valor de x= -5
Ingrese el valor de n= 4
aproxi cos(x) error
-13.1597 0.2837 47.3922
5.- PROBLEMA 25
x=input('Ingrese el valor de x= ');n=input('Ingrese el valor de n= ');
x1=[];
x2=[];
x3=[];
for i=0:n-1
x1(i+1)=coseno(x,i);
x2(i+1)=cos(x);
x3(i+1)=abs(x1(i+1)-x2(i+1))/x2(i+1);
end
disp(' aproxi cos(x) error');disp([x1' x2' x3']);
(ESCRIBIR EL NOMBRE DEL EJERCICIO)
Ingrese el valor de x= 1
Ingrese el valor de n= 4
aproxi cos(x) error
1.0000 0.5403 0.8508
0.5000 0.5403...
Regístrate para leer el documento completo.