xxxxxxxxxx
string name("Alice");
string name2 = ("Hafsa", "Mona"); // last one will be print
string name3{"Sona"};
string nam4 = "Selena";
xxxxxxxxxx
#include <iostream>
int main() {
std::cout << "Hello, World!"; // prints 'Hello, World!' to the output.
return 0;
}
xxxxxxxxxx
#include <iostream>
using namespace std;
int main(){
cout<<"Hello World!"<< endl; // prints "Hello World"
return 0;
}
xxxxxxxxxx
#include <iostream>
using namespace std;
int main() {
cout << "ENTER TEXT HERE";
return 0;
}
xxxxxxxxxx
#include <iostream>
using namespace std;
int main() {
cout << "me";
return 0;
}
xxxxxxxxxx
#include <iostream> // libary, where object cout is defined
using namespace std; // in order to reduce writing std::
int main() { // entry point
cout << "Hello World"; // print
return 0; // success exit
}
xxxxxxxxxx
// essential things
#include <iostream>
#include <string>
using namespace std;
//string variable
string printMe = "hehe cool";
int main(){
//print text
cout << printMe << endl;
// ^^^^^^^^ string variable
return 0;
}