ok so i used the code listed below, BUT when i build the solution an error shows and says that "cout, cin, and endl" are "undefined"
I am using Microsoft Visual studio 2010.... can anybody help me to figure out why it keeps saying this? please i would greatly appreciate it.
#include <iostream>
int main()
{
double sum = 0.0;
for (int i = 0; i < 10; i++) {
double input;
cout << "num" << i << "#: ";
cin >> input;
sum += input;
}
They are inside the std namespace.
You can fix that by adding usingnamespace std after the line #include<iostream>
or prepending std:: to cin cout and endl.