News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

cout was not declared in this scope error

Started by new.programmer, May 20, 2014, 08:20:24 PM

Previous topic - Next topic

new.programmer

#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?

stahta01

#1
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

Jenna

Topic locked, because it violates our forum rules!