Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- void main()
- {
- float a,b,m;
- char z;
- printf("Please enter:\nL to solve a linear equation\nD to calculate the number of days in month\nW to calculate the number of weeks and days\n");
- fflush(stdin);
- scanf("%c",&z);
- if (z=='L')
- printf("Please enter the equation ax+b=0 arguments: a and b\n");
- fflush(stdin);
- scanf("%f%f", &a,&b);
- {
- if(a==0 && b==0)
- printf("There are infinity solutions\n");
- if(a!=0 && b!=0)
- {
- m=-b/a;
- printf("There is a single solution: %f\n", m);
- }
- if(a==0 && b!=0)
- printf("There is no solution for the equation\n");
- }
- getchar();
- getchar();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement