Wednesday, September 22, 2021

1. My First Code.

         1. Any line starting with // is a comment

        2. #include <iostream> to use cout that allows us to print output on the screen.
       
3 using namespace std; statement so we can use nicknames for our variables
       
4. int main() {...} A valid C++ program must have the main() function. The curly braces indicate the start and the end of the function.
       
5. cout in our program to print output on the screen.
       
6. cout << "Hello World!"; The execution of code beings from this function.
       
7. The return 0; statement is the "Exit status" of the program.
        Note:
; is used to indicate the end of a statement.

        CODE


        #include <
iostream> // to use input and output   
 
       using namespace std; // use nickname to variables

       
int main() // main function

       
{ // open curly braces or tag

       
cout<<"Hello Boyswillcode!"<<endl;

       // cout<< is the code for saying print out
      // endl means endline

       
return 0; // return the value from zero

       
} // closing tag or curley braces













No comments:

Post a Comment

Contact Us

Contact Form

Name

Email *

Message *