New Member FAQ | Forums | Earn Revenue


Resources Entrance Ask Experts Exam Papers Jobs English Projects Universities Colleges Courses Schools Training My India



My Profile
Active Members
TodayLast 7 Days more...



Awards & Gifts
Online Exams

Fresher Jobs


Our fresher job section is exclusively for fresh graduates! Find jobs for freshers in major Indian cities including Bangalore, Chennai, Hyderabad, Pune or Kochi

Resources


Find educational articles, blogs, discussion threads and other resources.

Colleges


Find details about any college in India or search for courses.

website counter



PROGRAM TO FIND THE ROOTS OF EQ. ax^2 + bx + c = 0 .


Posted Date:     Total Responses: 0    Posted By: Piyush   Member Level: Bronze   Points/Cash: 2   


#include

#include

#include

template

void quad(temp a ,temp b ,temp c)

{

temp r1,r2,d;

d=b*b-(4*a*c);

if(d==0)

{

r1=(-b/(2*a));

cout<<"\n\nRoots are equal and real ->";

cout<<"\n\n r1=r2= "<
}

else if(d>0)

{

cout<<"\n\nRoots are real and unequal ->";

r1=(-b+sqrt(d))/(2*a);

cout<<"\n\n r1= "<
r2=(-b-sqrt(d))/(2*a);

cout<<"\n\n r2= "< }

else

{

cout<<"\n\nRoots are complex and imaginary ...";
}

}

void main()

{

clrscr();

float a,b,c;
cout<<"\n\nEnter values of a ,b and c for eq. a*x^2+b*x+c=0: ";
cout<<"\n\nEnter first value : ";
cin>>a;
cout<<"\n\nEnter second value : ";
cin>>b;
cout<<"\n\nEnter third value : ";
cin>>c;
quad(a,b,c);
getch();

}



Project Feedbacks


No feedbacks found. Be the first to respond and make money from revenue sharing program.

Post Feedback
You must Sign In to post a feedback.
Next Project: Involute gear profile error detector
Previous Project: PROGRAM TO FIND SMMALEST NO. FROM AN ARRAY USING TEMPLATE FUNCTION.

Return to Project Index

Post New Project


Related Projects



Advertise Here





Contact Us   Advertise   Editors    Privacy Policy    Terms Of Use   

ISC Technologies.
2006 - 2009 All Rights Reserved.