Here is the source code of the C program to solve any linear equation in one variable. The C program

Here is the source code of the C program to solve any linear equation in one variable. The C program

Here is the source code of the C program to solve any linear equation in one variable. The C program is successfully compiled and run on a Linux system. The program output is also shown below.

  1. #include
  2. #include
  3. float solve_for_y(float a, float b, float c)
  4. {
  5. float Y = Y = -(b + c) / a;
  6. return Y;
  7. }
  8. main()
  9. {
  10. float a, b, c, Y;
  11. printf(“\nEnter a linear equation in one variable of the form aY + b + c = 0 “);
  12. printf(“\nEnter the value of a, b, c respectively: “);
  13. scanf(“%f%f%f”, &a, &b, &c);
  14. Y = solve_for_y(a, b, c);
  15. printf(“\nSolution is Y = %f”, Y);
  16. }