#include<stdio>
#include<iostream>
#include<conio>
/* 2 point form*/
float x1,x2,y1,y2;
cout << "\n Enter values in order x1,x2,y1,y2: ";
cin>>x1>>x2>>y1>>y2;
float slope;
slope=(y2-y1)/(x2-x1);
float c=y1-slope*x1;
cout<<"\nThe equation of the line is : y="<<slope<<" x + "<<c<<endl;
zeroground
0
Newbie Poster
Recommended Answers
Jump to Postyou have to put all that code in a main() function
// includes go here int main() { // code goes here return 0; }
Jump to Post>can u tell me how to change the color of the background and text ?
There's no standard way to do it, but because you seem to be using a Windows compiler, I'd say this is your best bet.>#include<stdio>
Remove this, you're not using anything …
Jump to PostAnd stop making multiple threads on the same stupid with the same stupid title. Please read the RULES.
Jump to Post>Header conio.h has this function for working with text:
Prove it. I can only think of one compiler vendor that supplies that particular function with their version of conio.h. All of the others would fail to compile code that uses it.
Jump to PostIt doesn't work with Code::Blocks. I think it works only in the old version of C compiler such as Turbo C.
All 21 Replies
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
zeroground
0
Newbie Poster
Narue
5,707
Bad Cop
Team Colleague
WaltP
2,905
Posting Sage w/ dash of thyme
Team Colleague
Salem
commented:
Yeah, you tell 'em!
+12
zhelih
-1
Junior Poster
Narue
5,707
Bad Cop
Team Colleague
zhelih
-1
Junior Poster
zhelih
-1
Junior Poster
invisal
381
Search and Destroy
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
Narue
5,707
Bad Cop
Team Colleague
ShawnCplus
456
Code Monkey
Team Colleague
zhelih
-1
Junior Poster
invisal
381
Search and Destroy
ShawnCplus
456
Code Monkey
Team Colleague
invisal
381
Search and Destroy
zhelih
-1
Junior Poster
zandiago
115
Nearly a Posting Maven
Featured Poster
ShawnCplus
456
Code Monkey
Team Colleague
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
invisal
381
Search and Destroy
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.