News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

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!