12 December 2015 2 172 Report

I also  want that the user just  enters numbers.

clear all;

close all;

x= -10:1:10;

A=input('Enter the A value ');

if A == 0

   disp(' A is = 0');

end

B=input('Enter the B value ');

C=input('Enter the c value ');

y= (-B + sqrt(B.^2 -4*A*C))/2*A;

plot(x,y,'-r');

hold on

x1=-10:1:10;

y1= (-B - sqrt(B.^2 -4*A*C))/2*A;

plot(x1,y1);

Similar questions and discussions