Write a program in pascal to solve a quadratic equation

1 answer
Question:

write a program in pascal to solve a quadratic equation

Answers

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*cif a=0 then x1=x2= - c/b          elseif 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.

Similar Solved Questions

1 answer

Americans’ disillusionment over world war i led the united states government to adopt a policy of:

americans’ disillusionment over world war i led the united states government to adopt a policy of:...
1 answer

The bungalow is different…………….the terrace house.

The bungalow is different…………….the terrace house....
1 answer

The flag of a country contains an isosceles triangle. (Recall that an isosceles triangle contains two angles with the same measure.) If the measure of the third angle of the triangle is 15º more than three times the measure of either of the other two angles, find the measure of each angle of the triangle. (Recall that the sum of the measures of the angles of a triangle is 180°.)

The flag of a country contains an isosceles triangle. (Recall that an isosceles triangle contains two angles with the same measure.) If the measure of the third angle of the triangle is 15º more than three times the measure of either of the other two angles, find the measure of each angle of the tr...
1 answer

Put this equation, x^3-x^6+x^8-5 in standard form.

Put this equation, x^3-x^6+x^8-5 in standard form....
1 answer

A container has 300 liters of water, and a second container has 700 liters of water. The first container begins filling up at a rate of 5 liters per minute at the same time the second starts draining at a rate of 6 liters per minute. Which equation can be used to find the number of minutes, r, that elapse before the two containers have the same amount of water?

A container has 300 liters of water, and a second container has 700 liters of water. The first container begins filling up at a rate of 5 liters per minute at the same time the second starts draining at a rate of 6 liters per minute. Which equation can be used to find the number of minutes, r, that ...
1 answer

How did the stamp act affect people lives? How did tax burden affect peoples lives?

How did the stamp act affect people lives? How did tax burden affect peoples lives?...
2 answers

Claire is interested in the problem of depleting fish stocks in the ocean. Which subfield of marine biology can she study to ascertain the causes and solutions for this problem? A. aquaculture B. microbiology C. ichthyology D. environmental marine biology

Claire is interested in the problem of depleting fish stocks in the ocean. Which subfield of marine biology can she study to ascertain the causes and solutions for this problem? A. aquaculture B. microbiology C. ichthyology D. environmental marine biology...
2 answers

What happens to Everyman’s soul in the end?

What happens to Everyman’s soul in the end?...
2 answers

What’s the volume of the sphere?

What’s the volume of the sphere?...
1 answer

Draw a square that has (-2,4) and (3,-1) as two of its vertices

Draw a square that has (-2,4) and (3,-1) as two of its vertices...
1 answer

Which solid figure includes a base that is a circular disc, a vertex point not in the same plane as the base, and all the points between the base and the vertex?

Which solid figure includes a base that is a circular disc, a vertex point not in the same plane as the base, and all the points between the base and the vertex?...
2 answers

Jody asked her father to teach her how to drive. Her father had recently taken a class in behavior modification and reasoned that because driving was a novel behavior for Jody, she could be taught how to drive by a shaping procedure. What is the problem with this application of shaping?

Jody asked her father to teach her how to drive. Her father had recently taken a class in behavior modification and reasoned that because driving was a novel behavior for Jody, she could be taught how to drive by a shaping procedure. What is the problem with this application of shaping?...
1 answer

Twenty percent of all telephones of a certain type are submitted for service while under warranty. Of these, 60% can be repaired, whereas the other 40% must be replaced with new units. If a company purchases ten of these telephones, what is the probability that exactly four will end up being replaced under warranty

Twenty percent of all telephones of a certain type are submitted for service while under warranty. Of these, 60% can be repaired, whereas the other 40% must be replaced with new units. If a company purchases ten of these telephones, what is the probability that exactly four will end up being replace...
1 answer

What's the word phrase for 2(5-n)

What's the word phrase for 2(5-n)...
2 answers

How is converting grams to milligrams similar to converting pounds to ounces how is it different

How is converting grams to milligrams similar to converting pounds to ounces how is it different...
1 answer

A small town has about 5000 people. A random sample of 100 people finds that 25 are in favor of a new park. Estimate the total number out of 5000 who are in favor of the park

A small town has about 5000 people. A random sample of 100 people finds that 25 are in favor of a new park. Estimate the total number out of 5000 who are in favor of the park...

-- 0.012017--