Code Explained -By E3 School

In this tutorial complete explain basic code in c++. So start the point code explained. Basic Syntax.

Question:

  1. what is c++ code?
  2. why use #include<iostream>?
  3. why use "using namespace std"?
  4. why use "int main"?
  5. why use curly brackets "{  }"?
  6. why use return value?
  7. How to write a code in c++?

Code explained c++

Explained Code

  1. #include <iostream>
  2. using namespace std;
  3. int main() 
  4. {
  5. cout << "Hello World!";
  6.   return 0;
  7. }

#include<iostream>

#include<iostream> .It is the predefined library function used for input and output also called header files. iostream is the header file which contains all the functions of programs like cout, cin, etc. and #include tells the preprocessor to include these header file in the program.

Explained Code

  1. #include <iostream>
  2. using namespace std;
  3. int main() 
  4. {
  5. cout << "Hello World!";
  6.   return 0;
  7. }

Using namespace std:

Using namespace std. This means that we can use names for objects and variables from the standard library.

Explained Code

  1. #include <iostream>
  2. using namespace std;
  3. int main() 
  4. {
  5. cout << "Hello World!";
  6.   return 0;
  7. }

Int main():

Another thing that always appears in the C++ program, is int main(). This is called a function of any code inside its curly brackets.
Code Explained by e3 school

Explained Code

  1. #include <iostream>
  2. using namespace std;
  3. int main() 
  4. {
  5. cout << "Hello World!";
  6.   return 0;
  7. }

cout << "Hello World! ";.

cout << "Hello World! ";
.The C++ cout statement is the instance of the iostream class. It is used to produce output on the standard output device which is usually the display screen.

Otherwise Defination: Cout Statement Output the result displays the screen. For Example: “Hello World” Show the message on screen.

Explained Code

  1. #include <iostream>
  2. using namespace std;
  3. int main() 
  4. {
  5. cout << "Hello World!";
  6.   return 0;
  7. }

Return 0:

return 0; return 0 Ends the main Function.
Code Explained by e3 school

Topic:

Bill Gate:

It's fine to celebrate success but it is more important to heed the lessons of failure.

Post a Comment

Virtually nothing is impossible in this world if you just put your mind to it and maintain a
positive attitude.

Previous Post Next Post