#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
double x1,x2,x3,y1,y2,y3;
cout<< "Enter the coordinate x1,y1,x2,y2,x3,y3"<<endl;
cin>>x1>>y1>>x2>>y2>>x3>>y3;
double x = ((x1+x2+x3)/3) ;
double y = ((y1+y2+y3)/3) ;
cout<< "The centroid(G) is = " <<x,<<y;
system("Pause");
return(0);
}
I want to design a program using C++ code to show centroid = (x,y ) with comma in between x and y , but i tried the above, but compilation error occured.
putting comma in cout (C++)