#include <iostream>
using std::cout;
int main()
{
cout<<"Hello world";
return 0;
}
#include <iostream>
using namespace std;
int main()
{
cout << "[Enter Text Here]" << endl;
return 0;
}
#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 "
" or new line
return 0; //just exiting the program
}
#include <iostream>
using namespace std;
int main(){
cout<<"hello world!"<<endl;
return 0;
}
std::cout << "Hello World!" << std::endl; //Or you can do
std::cout << "Hello World!" <<; //Only in some scenarios
The cout object in C++ is an object of class ostream.
cout << "Your text";
//or
cout << "Your text" << endl;
//or
int x = 5;
cout << "x = " << x << endl;
//or
cout << "x = " << x;
Code Example |
---|
Cpp :: quicksort |
Cpp :: c++ float and double |
Cpp :: How do I read computer current time in c++ |
Cpp :: c++ lettura file |
Cpp :: insert in vector |
Cpp :: how to initialize 2d array with values c++ |
Cpp :: c++ finding gcd |
Cpp :: SUMOFPROD2 |
Cpp :: attention nlp |
Cpp :: find substring in string c++ |
Cpp :: c++ reverse part of vector |
Cpp :: c++ average vector |
Cpp :: read string with spaces in c++ |
Cpp :: sum array c++ |
Cpp :: dice combinations cses solution |
Cpp :: looping in map c++ |
Cpp :: C++ Calculating the Mode of a Sorted Array |
Cpp :: one away coding question |
Cpp :: how to access a vector member by its index |
Cpp :: Initialize Vector Iterator |
Cpp :: c++ thread wait fro 1 sec |
Cpp :: even and odd in c++ |
Cpp :: find maximum sum in array of contiguous subarrays |
Cpp :: array 2d to 1d |
Cpp :: DS1302 |
Cpp :: erase range vector c++ |
Cpp :: queue operations c++ |
Cpp :: c++ copy constructor |
Cpp :: vector size c++ |
Cpp :: C++ Syntax for Passing Arrays as Function Parameters |