1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
garri49 [273]
3 years ago
12

Write a program in pascal to solve a quadratic equation

Computers and Technology
1 answer:
GalinKa [24]3 years ago
5 0
Program p1;
var a,b,c,d : integer; {i presume you give integer numbers for the values of a, b, c }
     x1, x2 : real;
begin 
write('a='); readln(a);
write('b='); readln(b);
write('c=');readln(c);
d:=b*b - 4*a*c
if a=0 then x1=x2= - c/b
          else
if d>0 then begin 
                 x1:=(-b+sqrt(d)) / (2*a);
                 x2:=(-b - sqrt(d))/(2*a);
                end;
          else if d=0 then x1=x2= - b /(2*a)
                           else write ("no specific solution because d<0");
writeln('x1=', x1);
writeln('x2=',x2);
readln;
end.
You might be interested in
In Python please.
SOVA2 [1]

Answer:

negatives = []

zeros = []

positives = []

while True:

   number = input("Enter a number: ")

   if number == "":

       break

   else:

       number = int(number)

       if number < 0:

           negatives.append(number)

       elif number == 0:

           zeros.append(number)

       else:

           positives.append(number)

for n in negatives:

   print(n)

for z in zeros:

   print(z)

for p in positives:

   print(p)

Explanation:

Initialize three lists to hold the numbers

Create a while loop that iterates until the user enters a blank line

Inside the loop:

If the number is smaller than 0, put it in the negatives list

If the number is 0, put it in the zeros list

Otherwise, put the number in the negatives list

When the while loop is done, create three for loops to print the numbers inside the lists

5 0
3 years ago
How to calculate 3 X (50 + 40) ÷ 5 on excel 2016
kozerog [31]

Answer:

I think this might help, don't know much of this

Explanation:

How do you calculate 3.5 increase in Excel?

How To Increase a Number By a Percentage. If want to calculate a percentage increase in Excel (i.e. increase a number by a specified percentage), this can be done by simply multiply the number by 1 + the percentage increase. - which gives the result 60.

8 0
3 years ago
Read 2 more answers
Una pregunta cuales son los ataques de Sindel que por favor y me lo diga gracias
Len [333]
I do not know spanish please say in english
5 0
3 years ago
All of the following are examples of software, except:
Bezzdna [24]
Speakers is your answer
7 0
3 years ago
Read 2 more answers
Define quality control​
tangare [24]

Quality control is a system of maintaining standards in manufactured products by testing a sample of the output against the specification.

8 0
3 years ago
Other questions:
  • Typically, a dvd has how many times more capacity than a cd?
    5·1 answer
  • Assume the following JavaScript program was interpreted using staticscoping rules. What value of x is displayed in function sub1
    12·1 answer
  • 8) The higher the drag coefficient, the_____ the car will go<br> a)Siower<br> b)Faster
    9·2 answers
  • Which method is used for resolving data dependency conflict by the compiler itself?
    6·1 answer
  • Which of the following operation is not performed by a mouse 1) left click , middle click , right click, double click​
    15·2 answers
  • Why are mobile phone called cell phones?​
    13·1 answer
  • What means the data is still saved even if you turn the computer off or unplug it?​
    5·1 answer
  • Jak sie pisze oł na klawiaturze komputerowej
    11·1 answer
  • What are the components of computer system??<br>​
    10·2 answers
  • QUESTION 10
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!