xxxxxxxxxx
cout << "Your text";
//or
cout << "Your text" << endl;
//or
int x = 5;
cout << "x = " << x << endl;
//or
cout << "x = " << x;
xxxxxxxxxx
#include <iostream>
using std::cout;
int main()
{
cout<<"Hello world";
return 0;
}
xxxxxxxxxx
#include <iostream>
using namespace std;
int main()
{
cout << "[Enter Text Here]" << endl;
return 0;
}
xxxxxxxxxx
#include <iostream> //the library that contains cout
//cout is located in the "std" namespace so you can just say
//"using namespace std" to directly have access to cout or you can just
//type std::cout and it well work the same
int main()
{
std::cout << "text" << std::endl; //endl is basicly the same as printing "\n" or new line
return 0; //just exiting the program
}
xxxxxxxxxx
#include <iostream>
using namespace std;
int main(){
cout<<"hello world!"<<endl;
return 0;
}
xxxxxxxxxx
std::cout << "Hello World!" << std::endl; //Or you can do
std::cout << "Hello World!" <<; //Only in some scenarios