1#include <iostream>
2
3
4int main(){
5 std::cout <<"Hello World" << std::endl;
6 return 0;
7}
8
1// Your First C++ Program
2
3#include <iostream>
4
5int main() {
6 std::cout << "Hello World!";
7 return 0;
8}
9
1#include <iostream> // Include standard library and namespace
2using namespace std; // for c++
3
4int main () // where program starts
5{
6 cout << "Hello World!\n"; // cout (part of std) prints message
7 return 0; // return int because main is of type int
8}
1#include <iostream>
2
3using namespace std;
4
5int main() {
6 cout << "Hello World" << endl; // endl = '\n'
7 return 0;
8}
1#include <iostream>
2
3int main()
4{
5 std::cout << "Hello World!"; //you can add new line by adding "\n" or {<< endl}
6 return 0; //exit code 0
7}
1#include <iostream>
2using namespace std;
3
4int main() {
5 cout << "Hello World" << endl;
6 return 0;
7}
1#include <iostream>
2using namespace std;
3int main()
4{
5 cout<<"Hello World!";
6 return 0;
7}
1#include <iostream>
2
3int main() {
4 std::cout << "Hello World!";
5 return 0;
6}