Code:
#include <iostream>
#include <fstream>
#include <cmath>
using namespace std;
int main()
{
double num1;
double num2;
double num3;
int sum[3] = {num1,num2,num3,};
int suma = 0;
cout << "Please enter your three numbers\n" << endl;
cin >> num1 >> num2 >> num3 >> endl;
for ( int x = 0; x < 4; x++ ) {
suma += sum[x];
cout << suma << endl;
}
cin.get();
}
What i want to do is, let the user enter 3 numbers to find the sum of them.
it says error: no matchfor 'operator>>' in '((std::basic_istream<char, std::char_traits<char>... (line15, (the cin >> num1 >> num2 >> num3... line)
what does this mean? and how come my code doesn't work? thanks!