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
What is the Purpose and function of the Global Positioning System (GPS)?
murzikaleks [220]
The global positioning system (GPS) is a space-based radio-positioning and time-transfer system. GPS satellites transmit signals to proper equipment on the ground. These signals provide accurate position, velocity, and time (PVT) information to an unlimited number of users on ground, sea, air, and space.
8 0
3 years ago
Ethan is responsible for writing the dialogue in a movie. Which role is he playing? Ethan is playing the role of a(n).....''BLAN
iVinArrow [24]
Screenwriter! A screenwriter's role is to pen the script for a film.
3 0
3 years ago
What is astronaut favourite key on keyboard? ​
Dennis_Churaev [7]

Answer:

The space bar is an astronauts favorite key

5 0
2 years ago
Read 2 more answers
Write a do-while loop that continues to prompt a user to enter a number less than 100, until the entered number is actually less
nataly862011 [7]

Complete Question:

Write a do-while loop that continues to prompt a user to enter a number less than 100, until the entered number is actually less than 100. End each prompt with a newline. Ex: For the user input 123, 395, 25, the expected output is:

Enter a number (<100):

Enter a number (<100):

Enter a number (<100):

Your number < 100 is: 25

Answer:

import java.util.Scanner;

public class num8 {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       int n;

       do{

           System.out.println("Enter a number (<100):");

           n= in.nextInt();

       }while(n>100);

       System.out.println("Your number < 100 is: "+n);

   }

}

Explanation:

Using Java programming language

Import the scanner class to receive user input

create an int variable (n) to hold the entered value

create a do while loop that continuously prompts the user to enter a number less than 100

the condition is while(n>100) It should continue the loop (prompting the user) until a number less than 100 is entered.

4 0
2 years ago
Read 2 more answers
You can view information for the individual people who will perform the tasks on theproject in the
marin [14]

Answer:

Resource Sheet view

8 0
2 years ago
Other questions:
  • What is <br> Warehouse schema.
    14·1 answer
  • On a wireless router, what gives out IP addresses?<br> DHCP<br> DNS<br> WPA<br> WPS
    7·1 answer
  • What is the software that manages and controls the activities and resources of the computer? O The CPU The OS The ALU The GUI D
    13·1 answer
  • In Word, a red wavy underline indicates a/an
    15·1 answer
  • Write a public static method named evens that takes in 1 argument int a, and returns a String containing all positive even numbe
    8·1 answer
  • Nia is editing a row in an Access table. The row contains the Pencil icon on the left end of the record
    12·2 answers
  • Hello my name is Phoenix I will like for you to friend me on Ro blox my user name is Jessiahcoleman and if u play BLOX fruits or
    13·1 answer
  • Write a program to generate the 1,8,27,64,125,226,343,512,729,1000 series.​
    12·1 answer
  • Can anyone suggest me any good complete isekai anime..​
    14·2 answers
  • Select the correct answer.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!