EJERCICIOS LP ZACARIAS

Páginas: 4 (849 palabras) Publicado: 5 de abril de 2013
1.
%SOLUCIONES REALES DE UNA ECUACION DE SEGUNDO GRADO
clc,clear all;
f=input('a*x^2+b*x+c');
a=input('valor de a: ');
b=input('valor de b: ');
c=input('valor de c: ');
if b^2-4*a*c==0for x=(-b+sqrt(b^2-4*a*c))/2
fprintf('una solucion = %g\n',x)
end
end
if b^2-4*a*c>0
for x=(-b+sqrt(b^2-4*a*c))/2;
y=(-b-sqrt(b^2-4*a*c))/2;
fprintf('dossoluciones = %g\n',x,y)
end
end
if b^2-4*a*cgv
disp('resultados:')
disp('''LOCAL''')
end
if gl=0 & x=10.1 & x=14 & x=17 & x=b & a>=c & b>=c
disp([c b a])
end
if a>=b & a>=c & c>=bdisp([ b c a ])
end
if b>=c & b>=a & a>=c
disp([c a b ])
end
if b>=a & b>=c & c>=a
disp([a c b])
end
if c>=a & c>=b & a>=b
disp([b a c ])
end
if c>=a & c>=b & b>=a
disp([a b c])
end5.
% CUADRANTE AL QUE PERTENECE UN PUNTO
clc, clear all;
x=input('valor de ''x'' : ');
y=input('valor de ''y'' : ');
if x>0 & y>0
disp('I Cuadrante')
else
if x0
disp('IICuadrante')
else
if xgbb
disp('gano B')
else
gbb>gab
disp('gano A')
end
else
disp('gano B')
end
end

8.%ESCRIBRIR SI LA FECHA ES CORRECTA
clc,clear all;
disp('FECHA')
disp('para el mes')
disp(' 1= enero')
disp(' 2=febrero')
disp(' 3=marzo')
disp(' 4=abril')
disp(' 5=mayo')
disp('6=junio')
disp(' 7=julio')
disp(' 8=agosto')
disp(' 9=setiembre')
disp(' 10=octubre')
disp(' 11=noviembre')
disp(' 12=diciembre')
x=input('dia(en numeros): ');
y=input('mes: ');z=input('año: ');
while z10000;
z=input('año: ');
end
disp('==================================')
if y==1
fprintf('%3i enero%6i\n',x,z)
else
if y==2
fprintf('%3ifebrero%6i\n',x,z)
else
if y==3
fprintf('%3i marzo%6i\n',x,z)
else
if y==4
fprintf('%3i abril%6i\n',x,z)
else
if y==5...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • lp ejercicios individuales
  • ZACARIAS
  • Zacarias
  • Zacarias
  • ZACARIAS
  • Zacarias
  • Zacarias
  • Zacarias

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS