CS Answer for programming page.65
Q4
program page65q4; uses wincrt; var A, B, C, D : integer; begin writeln('Enter coefficients'); write('A: '); readln(A); write('B: '); readln(B); write('C: '); readln(C); D := B*B-4*A*C; if D>0 then writeln('The roots are real and unequal'); if D=0 then writeln('The roots are real and equal'); if D<0 then writeln('The roots are not real') end. |
Q5
program page65q5; uses wincrt; var A, B, C : integer; x1, x2 : real; begin writeln('Enter coefficients'); write('A: '); readln(A); write('B: '); readln(B); write('C: '); readln(C); x1 := (-B+sqrt(B*B-4*A*C))/(2*A); x2 := (-B-sqrt(B*B-4*A*C))/(2*A); writeln('The roots are ',x1:0:2,' and ',x2:0:2) end. |
¡@