39.7k views
5 votes
Write a C++ program that prompt the user to enter three points (x1, y1), (x2, y2), (x3,y3) of a triangle and

1 Answer

3 votes

Answer:

#include<iostream>

using namespace std;

int main(){

int x1,x2,x3;

int y1,y2,y3;

cout<<"Enter the value of first point(x1,y1): ";

cin>>x1>>y1;

cout<<"\\Enter the value of second point(x2,y2): ";

cin>>x2>>y2;

cout<<"\\Enter the value of third point(x3,y3): ";

cin>>x3>>y3;

}

Step-by-step explanation:

first include the library iostream for use the input/output commands

then, write the main function. within the main function declare the variable which store the value of points.

after that, use the 'cout' for output. It has the function which print the value or message on the screen.

and 'cin' is used to store the value in the variable.

So, in the above code cout ask for enter the value of point and after enter value by user, cin store in the variables.

Note: you have to enter two value with space or by enter.

User Ckruczek
by
4.8k points