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
Agata [3.3K]
3 years ago
9

Write the program to solve quadratic equations, but if the discriminant is negative, output

Computers and Technology
1 answer:
Firdavs [7]3 years ago
8 0

Answer:

PROGRAM  QuadraticEquation Solver

  IMPLICIT  NONE

REAL :: a, b, c ;

  REA :: d ;

  REAL  :: root1, root2 ;

//read in the coefficients a, b and c

  READ(*,*)    a, b, c  

  WRITE(*,*)   'a = ', a

  WRITE(*,*)   'b = ', b

  WRITE(*,*)    'c = ', c

  WRITE(*,*)

// computing the square root of discriminant d

  d = b*b - 4.0*a*c

  IF (d >= 0.0) THEN              //checking if it is solvable?

     d     = SQRT(d)

     root1 = (-b + d)/(2.0*a)     // first root

     root2 = (-b - d)/(2.0*a)     // second root

     WRITE(*,*)  'Roots are ', root1, ' and ', root2

  ELSE                            //complex roots

     WRITE(*,*)  'There is no real roots!'

     WRITE(*,*)  'Discriminant = ', d

  END IF

END PROGRAM  QuadraticEquationSolver

You might be interested in
.Write a C++ program that displays your name and address (if you value your privacy, a fictitious name and address).
olga_2 [115]

Answer:

#include <iostream>

using namespace std;

int main() {

   cout<<"My name is Rajat Sharma"<<endl<<"My address is Flat no=23 GH=5 Paschim Vihar New Delhi 110087 India"<<endl;

return 0;

}

Explanation:

The program is written in C++ language.In the program I have used cout to print my name and the address.First the name will be printed then the address in the new line endl is used for new line.To print any sentence just put them in double quotes.The same sentence in the program will be printed on the screen.

5 0
3 years ago
What type of video games do you prefer buying?
Tamiku [17]
Mine is minecraft maybe
6 0
3 years ago
What is the difference between ascending order and descending order
Neporo4naja [7]

"Ascending" means starting low and going up.

"Descending" means starting high and coming down.


4 0
3 years ago
Read 2 more answers
NEEDED ASAP
kogti [31]

Explanation:

1. special key combination that causes specific commands to be executed typically shortcut keys combine the ctrl or alt keys with some other keys.

2. 5 example of shortcut keys are:-

  • 1. ctrl + A - select all
  • 2.ctrl + B - bold
  • 3. ctrl + C - copy
  • 4. ctrl + U - under line
  • 5. ctrl + v - paste

3. (i) open the start menu

(ii) open Windows task manager

(iii) close the currently active program

(iv) replace

(v) align center

4. the three importance of shortcut keys are :

  • efficient and time saving :- using shortcut make you more efficient at doing certain task on your computer .
  • multi-tasking :- being a multi Tasker is something required in life.
  • health benefit :- cutting down on your mouse usage by using keyboard shortcut can help reduce the risk of RSI (Repetitive Syndrome Injury).

5. shortcut keys are very helpful because it take less time. keyboard shortcuts are generally used to expedite common operation by reducing input sequence to a few keystrokes.

8 0
2 years ago
Each codec is stored within a file called a(n) ____ file.
frutty [35]
Im like 90% sure its a container file
5 0
3 years ago
Other questions:
  • WHAT SHOULD YOU DO IF AN ONCOMING CAR AT NIGHT APPROACHES WITH ITS HIGH-BEAMS ON?
    6·1 answer
  • Some cars are 100 percent efficient at converting energy from gasoline to energy of motion.
    11·2 answers
  • How can vlan hopping attacks be prevented on a network?
    10·1 answer
  • The ash and dust from a volcanic eruption can cause a _______ change in the environment.
    13·1 answer
  • Three IT Companies. Help me please!
    5·2 answers
  • Is full dive vr possible and can we accomplish it with today’s technology? Explain why
    13·2 answers
  • Two boxes overlap if their interiors have at least one point in common. Give an O(n log n)-time algorithm that decides if there
    8·1 answer
  • What are the benefits of team collaboration?
    13·2 answers
  • _______________ ________________ have human editors that evaluate, select, and organize websites into a hierarchy of categories.
    11·1 answer
  • Fill in the blanks with the correct words.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!