Write a c program to calculate the equation, C/C++ Programming

Assignment Help:

Write a C program to calculate the output Y for a given value of X for the following formula

  Y=X2 + 2X +3
  #include stdio.h
  void main()
  {
  char promt;
  float y,x;
  printf("Please enter in the real value of X\n\r");

scanf("%f",&x);
y = (x*x) + 2*x + 3;     
printf("The value of Y is %f \n\r",y);  
printf("Press any key to exit \n\r");
scanf("\n%c",&prompt);  
}


Related Discussions:- Write a c program to calculate the equation

What are arrays, What are Arrays? Numerous applications require the pro...

What are Arrays? Numerous applications require the processing of multiple data items that have identical characteristics. In such circumstances it is frequently convenient to p

Explain virtual functions, Virtual Functions The keyword virtual was pr...

Virtual Functions The keyword virtual was previously used to resolve ambiguity for a class derived from two classes, both having a common ancestor. These classes are known as v

Beginning C++ Through Game Progammin, you are to create a text adventure ga...

you are to create a text adventure game that uses pointers. You have a rich, eccentric Uncle Billy who is soon to be deceased. How soon.....oops......he''s gone. He has left yo

Explain polymorphism, Polymorphism C++ supports this idea - that differ...

Polymorphism C++ supports this idea - that different objects do "the right thing "- by function polymorphism and class polymorphism. Poly means many, while morph means form.

Minimum shelf, At a shop of marbles, packs of marbles are prepared. Packets...

At a shop of marbles, packs of marbles are prepared. Packets are named A, B, C, D, E …….. All packets are kept in a VERTICAL SHELF in random order. Any numbers of packets with thes

C program to display a rectangle, Aim: To implement a program to display a...

Aim: To implement a program to display a rectangle, circle and triangle. Code:                       class shape {             public:                         vir

Illustrate the function definition, Illustrate the Function Definition? ...

Illustrate the Function Definition? The C code that explains what a function does is called the function definition. A function definition has the following form Type fun

Prime no., program to find if a no . is prime or not

program to find if a no . is prime or not

How do one throw polymorphically?, How do one throw polymorphically?       ...

How do one throw polymorphically?               A: Sometimes people write code such as: class MyExceptionBase { }; class MyExceptionDerived : public MyExceptionBase { };

Describe overloading??, A: Along with the C++ language, you can overload op...

A: Along with the C++ language, you can overload operators and functions. Overloading is the practice of supplying more than one definition for a provided function name in the same

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd