From 63a84ebbb10fbf203966a3daac348670a8c63035 Mon Sep 17 00:00:00 2001 From: maulikaluthra <56387512+maulikaluthra@users.noreply.github.com> Date: Tue, 20 Oct 2020 19:26:05 +0530 Subject: [PATCH] Create helloworld.cpp first lesson --- helloworld.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 helloworld.cpp diff --git a/helloworld.cpp b/helloworld.cpp new file mode 100644 index 0000000..501f448 --- /dev/null +++ b/helloworld.cpp @@ -0,0 +1,18 @@ +//This is the basics of cpp + +//This is the inbuilt header file which exactly means 'input output stream'. +//It takes care of the functions such as cin, cout etc, which is used to take input and print output +#include + +using namespace std; +//“using namespace std” means we use the namespace named std. “std” is an abbreviation for standard. +//If we don’t want to use this line of code, we can use the things in this namespace like this. std::cout, std::endl. +//If this namespace is not used, then computer finds for the cout, cin and endl etc.. Computer cannot identify those and therefore it throws errors. + +//int main is our driver function, which is the main function called whenever a cpp file is executed +int main() { + cout << "Hello World!"; //If we have hadn't written 'using namespace std', our statement would have been + //std::cout << "Hello World!"; + return 0; + //'int' in int main means we have to return an integer value +}