Skip to main content

Simple c program for find roots of polynomial (basic coding).

This program is for find roots of polynomial in which X has maximum power is 2 and coefficient of X^2 is not equal to zero.
#include<stdio.h>
#include<math.h>

void main()
{
     float a,b,c,d,e,f;
     printf("enter the  coefficient of X^2:");
     scanf("%f",&a);
     printf("enter the  coefficient of X:");
     scanf("%f",&b);
     printf("enter the value of  constant:");
     scanf("%f",&c);
     d=(b*b)-(4*a*c);
     if(d>=0&&a!=0)
        {
                 e=(-b+sqrt(d))/(2*a);
                 f=(-b-sqrt(d))/(2*a);
            printf ("Root 1 =%f",e);
            printf ("Root 2 =%f",f);
         }
      if(d<0&&a!=0)
         {
           e=-b/(2*a);
            f=sqrt(-d)/(2*a);
           printf ("Root 1=%f+%fi",e,f);
           printf ("Root 1=%f-%fi",e,f);
          }

}

For your choice program please tell me in comment box. 

Popular posts from this blog

Top ten Most Expensive Diamonds in the World for ever in history

Diamonds last forever, diamonds are a girl’s best friend, a diamond in the rough: these sayings all emphasise the beauty and strength of world’s most famous gems. Take a look at the 10 most expensive diamonds in the world in this Catawiki story! 10. The orange - 32 million euros This 14.82-carat bright orange diamond broke a world record when it sold for 32 million euros in 2013. Generally, pink and blue diamonds are the most sought after, but this rare gem surprised the world with its orange beauty and size. 9. The Princie - 33 million euros This pink, 34.54- carat diamond has been known of for 300 years now, after it was discovered in the Golconda mines in India. It was bought from the Hyderabad Royal family in 1960 by jewellers Van Cleef & Arpels, who named it the Princie after the son of Sita Devi, the Maharanee of Baroda, an extravagant and famous socialite living in Paris. 8. Graff Vivid Pink – 38,7 million euros A rectangular 24.78-carat diamond, classified

Realme 3 Pro vs Redmi Note 7 Pro Camera Comparison: And the Winner is?

With a profoundly aggressive price tag, Realme 3 Pro made its  official debut  in India just earlier this week to take on the smartphone, which is better known as the budget king – Redmi Note 7 Pro. The cameras are important for when you make a buying decision and while Xiaomi has banked on the hype around 48MP sensors to court buyers for its latest budget offering, Realme has resorted to borrowing the camera sensor from its sister company’s flagship smartphone – the OnePlus 6T. So, let’s not waste any more time and answer the one question which might have been bugging you. How does the Sony IMX519 sensor on Realme 3 Pro compare to the Sony IMX586 on Redmi Note 7 Pro? Realme 3 Pro vs Redmi Note 7 Pro: Specs Before we check out the camera samples and see how they compare, here’s a quick peek at the camera specifications for both the smartphones. The Redmi Note 7 Pro, as most of you, would already know brings along  a primary 48MP (f/1.7) rear sensor (the Sony IMX586) coupled

Top ten best Construction Companies in the World(all details of company)

How the Biggest Construction Companies in the World Are Building Our Cities and Workforce Saying the construction industry is large would be a gross understatement. As one of the oldest industries to date, construction has skyrocketed over the last thousands of years–and it keeps growing. Indeed, the global construction market is  expected to grow to a massive $8 trillion  by 2030. With this anticipated increase, today’s construction companies have their work cut out for them, to say the least. In fact, just to keep up with our world’s basic infrastructure needs,  an estimated $3.3 trillion per year  will need to be spent on infrastructure through 2030.   Beyond meeting our world’s most fundamental building needs, construction companies, large and small, are making a huge impact on our global economy. Although the U.S. has one of the largest construction industries in the world, at  approximately $1.18  trillion in 2017 alone, the majority of the world’s largest construction