Answer:
#include<iostream>
using namespace std;
int main(){
float x1,x2;
float y1,y2;
float slope;
cout<<"Enter the value of first point(x1,y1): ";
cin>>x1>>y1;
cout<<"\\Enter the value of second point(x2,y2): ";
cin>>x2>>y2;
slope = (y2-y1)/(x2-x1);
cout<<"Slope is: "<<slope<<endl;
}
Step-by-step explanation:
First include the library 'iostream' for perform the operation of input/output.
after that, write the main function and declare the variable of points.
use the output command 'cout' for display the message on the screen.
use the input command 'cin' for store the value enter by user into the variable.
after that, use the formula to find the slope:

Note: All values declare in the code is float type means decimal value. but you can enter integer value as well.
finally, cout is used to display the output slope on the screen.