Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<conio.h>
- #include<math.h>
- void main()
- {
- int a,b,c;
- printf("Vvedite a, b, c:\n");
- scanf("%i %i %i", &a, &b, &c);
- float d,D;
- d=(b*b)-4*a*c;
- if (d < 0)
- {
- printf("Korney net");
- exit(1);
- }
- D=sqrt(d);
- float x1,x1;
- x1 = (-b+D)/(2*a);
- x2 = (-b-D)/(2*a);
- printf("x1 = %f; x2 = %f. \n", x1, x2);
- getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment