cin, cout & enld not in scoope

What em I doing wrong



#include <iostream>

int main ()

{

int t = 0, value = 0;

while (cin>>value)

t+= value;

cout << "the value of t is: " <<t<<endl;

return 0;

}
You're using the std namespace without telling the compiler you are.
You can either write using namespace std; just after your #include, or you can write std::cin, std::cout, std::endl.
Topic archived. No new replies allowed.