Question: Correct the following code in C language: #include #include int main() { float x,a,b,c,y; int nu; { printf (Enter the value of x:); scanf(%f,&x); a
Correct the following code in C language:
#include
int main() { float x,a,b,c,y; int nu; { printf ("Enter the value of x:"); scanf(%f,&x); a = (x*x) - (7*x) + 10; b = 3*x+4; printf (" Value of a = %f, Value of b = %f", a,b); c=a; if(c>=9) {y=(a*a*a)/3 (2*b) + (b*b)/2;} else {y=(a+b)/2 ((a-b)/4);} printf(" The final result y = %f",y); printf(" Do you want to repeat calculation?(1-True,2-False):"); scanf ("%d,&nu"); } while(nu==1) return 0; }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
