Program to find root of quadratic equation
Estimating the origins of the quadratic equation is something that we have taught in childhood. Nevertheless, the quality of quadratic equations increased with experience. These methods to deal with The issue have also developed. In the section, we could make a feel the way to describe the new method to see the solution of the quadratic equation. Before entering into the coding section of the post, let’s first see what exactly is the quadratic equation? This part will give you a better understanding of quadratic equations which would aid in understanding This algorithm.
The quadratic equation, or the equation in short, is the equation in the form of ax^2 + BX + C = 0, where one is not equivalent to zero. These “ roots ” of this quadratic are the figures that fulfill the quadratic equation. There are usually two origins for any rectangle equation, although sometimes they may occur. Write down this equation in the structure of ax^2 + BX + C = 0. If this equation is in the shape y = ax^2 + BX +c, only put the y with 0. This is done because the origins of This equation are those measures where the y axis is same as 0. For instance, think that equation is 2x^2-20x + 5 = 0, where a = 2, B = -20, and C = 5. Compute the initial structure by using the formula x = /2a. Replace the measures of A, B, and C. At our case, x = /2_5, which equals 9.7. Notice that in order to get the first origin, the first component inside the large brackets has shifted its marks (because of multiple negative) and added to the 2nd item.
Q) write program to find root of quadratic equation?
sol) | ||
#include<math.h>
int main()
| ||
{ double distance,x1,x2,y1,y2; | ||
cout<<"enter the coordinates of point 1 :"; | ||
cin>>x1>>y1; | ||
cout<<"enter the coordinates of point 2 :"; | ||
cin>>x2>>y2; | ||
distance=sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)); | ||
cout<<"thedistance between("<<x1<<","<<y1<<")and("<<x2<<","<<y2<<") is : "<<distance<<endl; | ||
return 0; | ||
} Other related post:- Shutdown someone pc using notepad trick Let window speak to you Create quiz game using notepad Program to check planidrome Find factorial using program Program to check leap year Program to sort an array Program to multiply two matrixes Program to find root of quadratic equations Array coding interview questions Program creating basic calculator Program to convert Fahrenheit to Celsius or Celsius to Fahrenheit Program to implement distance formula Top featured feeds Top pattern problems Array coding interview questions |
0 Comments
if you have any doubt let me know in comment