WHAT'S NEW?
Loading...

So lets start with a simple programe which prints text on the computer

//program to print a text

#include<iostream.h>

int main()
{
    cout<<"yala yolo";
    return 0;
}

Let us look at the various parts of the above program:
  • // this symbol is used to write comments in the code. As you can see i used it tell what the code is about. Anything that is written after it is not compiled.  
  • The C++ language defines several headers, which contain information that is either necessary or useful to your program. For this program, the header <iostream> is needed.
  • The line int main() is the main function where program execution begins.
  • The next line cout << "yala yolo"; causes the message "yal yolo" to be displayed on the screen.
  • The next line return 0; terminates main( )function and causes it to return the value 0 to the calling process.
  • In C++, the semicolon is a statement terminator. That is, each individual statement must be ended with a semicolon. It indicates the end of one logical entity.
    For example, following are three different statements −
    cout<<"yala yolo";
     x=y;
OUTPUT OF THE ABOVE PROGRAM IS 

0 comments:

Post a Comment