SAADQUAMER

Untitled

Jul 25th, 2019
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.49 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4.  
  5.     int a,b,c,x;
  6.     scanf("%d%d%d%d",&x,&a,&b,&c);
  7.     if(x<0)
  8.        {
  9.  
  10.         printf("We can find the value of X using Bashkara's Formula.\n");}
  11.     else if(a<0)
  12.     {
  13.        a=(((-b*x)-c)/(x*x));
  14.         printf("%.2f\n",(float)a);
  15.     }
  16.     else if(b<0)
  17.     {
  18.         b=((-a*(x*x))-c)/(x);
  19.         printf("%.2f\n",(float)b);
  20.     }
  21.     else
  22.     {
  23.         c=(-a*(x*x)-b*x);
  24.         printf("%.2f\n",(float)c);
  25.     }
  26.  
  27.     return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment