Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- float a, b, x;
- printf("a = ");
- scanf("%f", &a);
- printf("b = ");
- scanf("%f", &b);
- if(a == 0 && b == 0)
- {
- printf("x = 0\n");
- }
- else if (a !=0)
- {
- x = -b/a;
- printf("x = %.2f\n", x);
- }
- else
- {
- printf("No solution");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment