Click here to Skip to main content
12,451,455 members (60,308 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as

Stats

4K views
2 bookmarked
Posted

A simple program to solve quadratic equations with

, 7 Nov 2010 CPOL
Rate this:
Please Sign up or sign in to vote.
#include<stdio...
#include<stdio.h>
#include<conio.h>
void main()
{
   float a,b,c,x1,x2;
   clrscr();
   printf("Enter a=");
   scanf("%f",&a);
   printf("Enter b=");
   scanf("%f",&b);
   printf("Enter b=");
   scanf("%f",&b);
   x1=(-(b)+(sqrt((b^2)-(4*a*c))))/(2*a)
   x2=(-(b)-(sqrt((b^2)-(4*a*c))))/(2*a)
   printf("x=%f",x1);
   printf("\n or \n x=%f",x2);
   getch();
}

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

TomSeaton
United States United States
No Biography provided

You may also be interested in...

Pro
Pro

Comments and Discussions

 
GeneralReason for my vote of 2 Poor error handling. Pin
CIDev11-Nov-10 3:20
memberCIDev11-Nov-10 3:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.160826.1 | Last Updated 8 Nov 2010
Article Copyright 2010 by TomSeaton
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid