Ex3-bhaskara.txt

  • Uploaded by: Gustavo Sousa
  • 0
  • 0
  • May 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Ex3-bhaskara.txt as PDF for free.

More details

  • Words: 72
  • Pages: 1
#include <stdio.h> #include <math.h> int main(void) { double a, b, c; scanf("%lf %lf %lf", &a, &b, &c); double delta = pow(b, 2) - 4 * a * c; if (delta < 0 || a == 0) { puts("Impossivel calcular"); return 0; } double result1 = (-b + sqrt(delta)) / (2 * a); double result2 = (-b - sqrt(delta)) / (2 * a); printf("R1 = %.5lf\nR2 = %.5lf\n", result1, result2); }

return 0;

More Documents from "Gustavo Sousa"

Ex4-cedulas.txt
May 2020 7
November 2019 9
Ex3-bhaskara.txt
May 2020 12