Answer to Question #223620 in C++ for ABDUL REHMAN GILAL

Question #223620

Write a C program to implement the following equations:

                  a) 2x5 - 3x4 + 5x3 - 3x2 + 7x – 9

 Where x is the user defined value.

                  b) x3sin(tan(45)) + 4x + 7cos(90x2)

Where the value of x is a floating point number provided by the user.


1
Expert's answer
2021-08-05T11:36:18-0400
#include <stdio.h>
#include <math.h>

int main()
{
    double x, f;

    printf("Enter double value: ");
    if(scanf("%lf", &x) != 1)
    {
        printf("Bad input\n");
        return 1;
    }
    f = 2*x*x*x*x*x - 3*x*x*x*x + 5*x*x*x - 3*x*x + 7*x - 9;
    printf("Result #1 is: %lf\n", f);

    printf("\nEnter double value: ");
    if(scanf("%lf", &x) != 1)
    {
        printf("Bad input\n");
        return 1;
    }
    f = x*x*x*sin(tan(45)) + 4*x + 7*cos(90*x*x);
    printf("Result #2 is: %lf\n", f);
    
    return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS