Code::Blocks Forums
User forums => Using Code::Blocks => Topic started by: new.programmer on May 20, 2014, 08:20:24 pm
-
#include<iostream>
int main()
{
cout << "a= ";
double a;
cin >> a;
cout "b= ";
double b;
cin >> b;
double p;
p=2*(a+b);
double s;
s=a*b;
cout << "p= " << p << "\n";
cout << "s= " << s << "\n";
return 0;
}
I get the following error: line 5 'cout' was not declared in this scope, how to fix it?
-
Read this FAQ http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F (http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F)
I suggest reading the others and finding a C++ book or support website.
Edit: C++ Website http://cboard.cprogramming.com/cplusplus-programming/ (http://cboard.cprogramming.com/cplusplus-programming/)
Tim S.
-
Topic locked, because it violates our forum rules!