hey, i am trying to create a program to multiply two matricies, i am very close, just this one thing stopping me, i get an error on line 16 & 17 (void display body) which states "void value not ignored as it ought to be". i know it will be something stupid i couldnt see, but here is my code so far:
#include <iostream>
#include <cstdlib>
usingnamespace std;
int TR, TL, BR, BL, TR2, TL2, BR2, BL2;
void TRR ()
{cout << (TL*TR2) + (TR*BR2);}
void TLR ()
{cout << (TL*TL2) + (TR*BL2);}
void BRR ()
{cout << (BL*TR2) + (BR*BR2);}
void BLR ()
{cout << (BL*TL2) + (BR*BL2);}
void display ()
{
TLR (); cout << " "; TRR () << endl;
BLR (); cout << " "; BRR () << endl;
}
int main()
{
cout << "Welcome to Andrew's 2 by 2 matrix multiplication program." << endl;
cout << "please enter the top left number of the first matrix: ";
cin >>TL;
cout << "please enter the top right number of the first matrix: ";
cin >>TR;
cout << "please enter the bottom left number of the first matrix: ";
cin >>BL;
cout << "please enter the bottom right number of the first matrix: ";
cin >>BR;
cout << "please enter the top left number of the second matrix: ";
cin >>TL2;
cout << "please enter the top right number of the second matrix: ";
cin >>TR2;
cout << "please enter the bottom left number of the second matrix: ";
cin >>BL2;
cout << "please enter the bottom right number of the second matrix: ";
cin >>BR2;
cout << "the answer is:" << endl;
display ();
return 0;
}