Create a c program that evaluates a quadratic function x^2 +5x +6. The main program will call a function passing the value for x (accepted as input) and the function returns the evaluated value. The evaluated value should be printed in the main program along with the x value. Output should be as follows, with at least the five different user inputs. The program should work repeatedly if the input is between -100.0 and 100.0 (end points not included). Assume the user will enter valid input. This program evaluates x^2 + 5x + 6 *** Note: Invalid values will terminate the program *** Enter a decimal value between -100.0 and 100.0 :-4.0 f(-4.0000> - 2.0000 Enter a dec imal value between -100.0 and 100.0 :-3.0 f(-3.0000) - 0.0000 Enter a decimal value between -100.0 and 100.0 :-2.5 f(-2.5000) - -0.2500 Enter a decimal value between -100.0 and 100.0 :-2.0 f(-2.0000) - 0.0000 Enter a decimal value between -100.0 and 100.0 :-1.0 f(-1.0000) - 2.0000 Enter a decimal value between -100.0 and 100.0 :4 f(4.0000> - 42.0000 Enter a decimal value between -100.0 and 100.0 :100 100.000 is invalid. Good bye

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

using chapter 1 to 5 from the book C how to program, eighth edition

Create a c program that evaluates a quadratic function x^2 +5x +6. The main program will call a function
passing the value for x (accepted as input) and the function returns the evaluated value. The evaluated
value should be printed in the main program along with the x value. Output should be as follows, with at
least the five different user inputs. The program should work repeatedly if the input is between -100.0
and 100.0 (end points not included). Assume the user will enter valid input.
This program evaluates x^2 + 5x + 6
*** Note: Invalid values will terminate the program ***
Enter a decimal value between -100.0 and 100.0 :-4.0
f(-4.0000> - 2.0000
Enter a dec imal value between -100.0 and 100.0 :-3.0
f(-3.0000) - 0.0000
Enter a decimal value between -100.0 and 100.0 :-2.5
f(-2.5000) - -0.2500
Enter a decimal value between -100.0 and 100.0 :-2.0
f(-2.0000) - 0.0000
Enter a decimal value between -100.0 and 100.0 :-1.0
f(-1.0000) - 2.0000
Enter a decimal value between -100.0 and 100.0 :4
f(4.0000> - 42.0000
Enter a decimal value between -100.0 and 100.0 :100
100.000 is invalid. Good bye
Transcribed Image Text:Create a c program that evaluates a quadratic function x^2 +5x +6. The main program will call a function passing the value for x (accepted as input) and the function returns the evaluated value. The evaluated value should be printed in the main program along with the x value. Output should be as follows, with at least the five different user inputs. The program should work repeatedly if the input is between -100.0 and 100.0 (end points not included). Assume the user will enter valid input. This program evaluates x^2 + 5x + 6 *** Note: Invalid values will terminate the program *** Enter a decimal value between -100.0 and 100.0 :-4.0 f(-4.0000> - 2.0000 Enter a dec imal value between -100.0 and 100.0 :-3.0 f(-3.0000) - 0.0000 Enter a decimal value between -100.0 and 100.0 :-2.5 f(-2.5000) - -0.2500 Enter a decimal value between -100.0 and 100.0 :-2.0 f(-2.0000) - 0.0000 Enter a decimal value between -100.0 and 100.0 :-1.0 f(-1.0000) - 2.0000 Enter a decimal value between -100.0 and 100.0 :4 f(4.0000> - 42.0000 Enter a decimal value between -100.0 and 100.0 :100 100.000 is invalid. Good bye
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY