#include <iostream> using namespace std; int main() { cout << "Hello world!"; return 0; } | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
- 2

#include <iostream> using namespace std; int main() { cout << "Hello world!"; return 0; }

When I enter this my laptop gives me 3 errors

2nd Oct 2019, 7:54 AM
Tushit Sharma 24 CODER
Tushit Sharma 24 CODER - avatar
12 ответов
+ 5
First of all, don't use "using namespace std". Sololearn made a very very big mistake trying to teach people C++ with that piece of bad practice. What it does is assumes everything with "cin" "cout" and other functions is in the standard library, when you can have similarly named functions from other libraries. If you want to type "cout" or "cin" without needing the "std::" prefix, just put "using std::cout" and "using std::cin" at the top of your program. The errors you're having, sounds like a compiler problem or syntax errors, either way, don't make a title your code, because we have no idea how you formatted the code itself now.
2nd Oct 2019, 9:37 AM
Sam Russell
Sam Russell - avatar
+ 3
Two cases are possible: 1) if you are doing programming in turbo C then include iostream.h and remove "using namespace std" statement because because turbo C uses older version of cpp and it requires .h extension and also it has no concept of namespaces. 2) and if you are using 32 bit compilers (g++) and ide's (codeblocks) then go to your compiler setting and enable either c++11 or c++14 standards because these standards have concept of namespaces and you need not to use .h extension with header files. 😊
4th Oct 2019, 7:49 AM
A2G4
+ 1
#include <iostream> using namespace std; int main() { int n; cin >> n; //your code goes here return 0; }
28th Dec 2021, 8:30 AM
Yoseph Solomon Ftwi
Yoseph Solomon  Ftwi - avatar
0
state the errors
2nd Oct 2019, 7:57 AM
✳AsterisK✳
✳AsterisK✳ - avatar
0
CPP1: unable to open include file 'IOSTREAM' CPP3: DECLARATION SYNTAX ERROR CPP6:UNDEFINED SYMBOL 'COUT'
2nd Oct 2019, 8:35 AM
Tushit Sharma 24 CODER
Tushit Sharma 24 CODER - avatar
0
Are you even using a c++ compiler?
2nd Oct 2019, 8:44 AM
Glenn 🙏
Glenn 🙏 - avatar
0
Replace "iostream" with "iostream.h" And erase that second line "using.." Check cout may be mistyped as Cout
2nd Oct 2019, 4:08 PM
Parampreet Rai
Parampreet Rai - avatar
0
Reinstall your compiler
3rd Oct 2019, 5:00 PM
Islombek
Islombek - avatar
0
#include <iostream> using namespace std; int main() { // your code goes here return 0; }
29th May 2021, 7:00 AM
Bäľâjî
Bäľâjî - avatar
0
#include <iostream> using namespace std; int main() { //your code goes here return 0; }
14th Dec 2021, 2:37 PM
Adile Eliyeva
0
#include <iostream> int main() { std::cout << "Hello, World!" << std::endl; return 0; }
3rd Jan 2023, 10:25 AM
business Tycoon
business Tycoon - avatar
0
#include<iostream> using namespace std; int main () { Cin>a>b; Cout<b; Cin>>a+b; Cuot<<"enter a'b"; Return 0; }
28th Feb 2024, 11:26 AM
Zenu Tesema
Zenu Tesema - avatar