Niloy007

Problem 1

Apr 11th, 2021
471
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. int main() {
  5.     double a, b, c;
  6.     scanf("%lf %lf %lf", &a, &b, &c);
  7.  
  8.     double x = sqrt((b * b) - (4 * a * c));
  9.     double res1 = (-b + x) / (2 * a);
  10.     double res2 = (-b - x) / (2 * a);
  11.  
  12.     printf("X1 = %.3lf\nX2 = %.3lf\n", res1, res2);
  13. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×