Error cin and cout were not declared | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Error cin and cout were not declared

hi guys i am a beginner in c++ kindly help me it says cout and cin were not declared

6th Jul 2017, 3:26 AM
bunty
31 Answers
+ 18
Did you include header file iostream? #include<iostream>
6th Jul 2017, 3:29 AM
Frost
Frost - avatar
+ 7
because turbo c++ does not use standard c++ it is from last century.
6th Jul 2017, 4:00 AM
jay
jay - avatar
+ 6
#include <iostream> using std::cout; int main() { cout << "This should also work\n"; return 0; }
6th Jul 2017, 3:36 AM
jay
jay - avatar
+ 4
Yup, should be one or both of these answers. Otherwise, you'll need to post some code.
6th Jul 2017, 3:31 AM
ChaoticDawg
ChaoticDawg - avatar
+ 4
typos.. well the number one 1 and the lowercase L look pretty similar in codeplayground
6th Jul 2017, 6:59 AM
jay
jay - avatar
+ 4
not here. the best you can do here is ascii art in cpp. elsewhere yes. with the help of other libraries, (or you could even write your own lol; they are huuuge projects)
6th Jul 2017, 7:17 AM
jay
jay - avatar
+ 4
no, only the basics of the langauage. but by learning the language you will know how to talk to the libraries.
6th Jul 2017, 7:20 AM
jay
jay - avatar
+ 4
yeah, not fair right. codeplayground has limited support for compiled languages
6th Jul 2017, 7:22 AM
jay
jay - avatar
+ 3
You may need to add: using namespace std; below your include statements.
6th Jul 2017, 3:29 AM
ChaoticDawg
ChaoticDawg - avatar
+ 3
thanks guys it worked perfect i am in debt of you guys sirry i cant upvote comment as my account is not activated but i followed you two thanks again
6th Jul 2017, 7:10 AM
bunty
+ 2
It's endl not end1 and make sure you have your semicolons.
6th Jul 2017, 6:42 AM
ChaoticDawg
ChaoticDawg - avatar
+ 1
You need to end every statement with a semicolon!
6th Jul 2017, 7:08 AM
ChaoticDawg
ChaoticDawg - avatar
+ 1
guys can i make a graphical like with c++
6th Jul 2017, 7:13 AM
bunty
+ 1
but people made calcuLtor using html
6th Jul 2017, 7:21 AM
bunty
+ 1
yeah this is absolutely not fair limited support in compiled languages
6th Jul 2017, 7:23 AM
bunty
0
you don't need "using namespace std" in turbo c++
6th Jul 2017, 3:49 AM
‎ ‏‏‎Anonymous Guy
0
thanks a lot guys for helping me https://code.sololearn.com/c53S4Fpi9b30/?ref=app this is the code plz plz tell mistakes in it thanks again to everyone who answered my question
6th Jul 2017, 6:34 AM
bunty
0
that problem was solved but still it doesnot give output i want plz help
6th Jul 2017, 6:36 AM
bunty
0
#include <iostream> using namespace std; int main() { int a; int b; int sum; cin>>a; cin>>b; sum=a+b; cout<<sum<<endl; return 0; }
6th Jul 2017, 6:39 AM
ChaoticDawg
ChaoticDawg - avatar
0
oh thank you i am Trying
6th Jul 2017, 6:40 AM
bunty