uninitialized variable

keeps telling my my variables are not initialized

int main()
{


float a1, a2, a3, b1, b2 ,b3, c1, c2, c3, d1, d2, d3, x, y, z;


cin >> a1, b1, c1, d1, a2, b2, c2, d2, a3, b3, c3, d3;

x = ((d1 * b2 * c3) + (b1 * c2 * d3) + (c1 * d2 * b3) - (c1 * b2 * d3) - (d1 * c2 * b3) - (b1 * d2 * c3))/((a1 * b2 * c3) + (b1 * c2 * a3) + (c1 * a2 * b3) - (c1 * b2 * a3) -(a1 * c2 * b2) - (b1 * a2 * c3));
y = ((a1 * d2 * c3) + (d1 * c2 * a3) + (c1 * a2 * d3) - (c1 * d2 * a3) - (a1 * c2 * d3) - (d1 * a2 * c3))/((a1 * b2 * c3) + (b1 * c2 * a3) + (c1 * a2 * b3) - (c1 * b2 * a3) -(a1 * c2 * b2) - (b1 * a2 * c3));
z = ((a1 * b2 * d3) + (b1 * d2 * a3) + (d1 * a2 * b3) - (d1 * b2 * a3) - (a1 * d2 * b3) - (b1 * a2 * d3))/((a1 * b2 * c3) + (b1 * c2 * a3) + (c1 * a2 * b3) - (c1 * b2 * a3) -(a1 * c2 * b2) - (b1 * a2 * c3));

cout << "The answers for x ,y and z would be " << x << " " << y << " " << z << endl;

return 0;
}
You are not reading in the variables properly. Chain them with repeated applications of >>, not the comma operator.
cin >> a1 >> a2 ...
Topic archived. No new replies allowed.