“HELLO WORLD!” Program in C++

hw proteach 2


Program in C++


The first program in every programmer’s life is to print “HELLO WORLD!” on the console.

This “HELLO WORLD!” program is the most simplest program but has a lot of impact on a new programmer.

This program is often used teach the main syntax of the programming language.


Hello world program 1




In this “HELLO WORLD!” Program there are many things we need to understand so we take a look at this program briefly. We will talk about the code line by line.



It means that we want to include some Library or some file which carries some function or some programs which we are including in this program we are about to write.


IOSTREAM is a library which carries function or programs which we can use in our program we are making. The IOSTREAM contains compiler made function which we use in our program.

Using namespace std

All the C++ libraries are declared with standard which is known as namespace. We can write the std with the code line as given in the EXAMPLE 2 of this same code. But it is better to write std up so we don’t have to write it again and again.

Int Main ()

Int main is a main body of our program in which we write our code to make our program. Every program in C++ consists of main program.

Int is the return value of the program main shall return an integer value before terminating itself.

Return 0

Return 0 means that main is returning 0 integer value. Return 0 causes the main function to terminate. Whenever you write a return statement in any of your function that function terminates itself returning the value given after return. It can be any value of the corresponding function you are making. It can be integer or character or double or float or anything you defined your function with or nothing.

cout << “HELLO WORLD!” ;

In this cout is the IOSTREAM LIBRARY OUTPUT function operator (PRINTING FUNCTION OPERATOR) which is self defined by the compiler LIBRARY itself.

The 2 less than signs means that we are going to output or print something on the console.

The “…” means that anything we have to just print on the screen or console we have to write between these “…”.

HELLO WORLD! Is a simple text we have written which we have to print on the console.


These are two curly brackets we write one at the start of the function and one at the end to indicate the start and the end of the respected function.


Semi-colon is the most important syntax in the C++ Every CODE line we write we have to close that code line with a semi-colon.




Check out our latest articles.




  1. Pingback: Input and Output Operators In C++ – Pro Teach Articles

  2. باك لينك

    March 2, 2020 at 8:07 pm

    This paragraph gives clear idea in favor of the new users of blogging,
    that truly how to do blogging and site-building.

  3. باك لينك

    March 4, 2020 at 7:32 pm

    I am not sure where you are getting your info, but good topic.

    I needs to spend some time learning much more or understanding more.
    Thanks for excellent info I was looking for this info for my mission.

  4. ارشفة المواقع

    March 5, 2020 at 6:34 pm

    Wow, incredible blog layout! How long have you been blogging for?
    you make blogging look easy. The overall look of
    your website is fantastic, let alone the content!

  5. ارشفة المواقع

    March 6, 2020 at 8:07 pm

    Hello, i think that i saw you visited my website thus i came to “return the favor”.I am attempting to find things
    to enhance my web site!I suppose its ok to use some of your ideas!!

  6. Hi every one, here every one is sharing such familiarity, therefore it’s nice to read this website, and I used
    to visit this weblog all the time.

  7. Just want to say your article is as amazing. The clearness in your post is just cool and i could
    assume you’re an expert on this subject. Fine
    with your permission let me to grab your RSS feed to keep updated with forthcoming post.

    Thanks a million and please continue the gratifying work.

  8. What’s up i am kavin, its my first occasion to commenting
    anywhere, when i read this paragraph i thought i could also create comment due to this
    sensible article.

  9. ارشفة المواقع

    March 13, 2020 at 4:22 am

    Wonderful article! That is the kind of info that are meant to be shared across the web.
    Shame on Google for now not positioning this post higher!
    Come on over and consult with my site . Thanks =)

  10. Justin

    March 23, 2020 at 7:59 am

    Long time supporter, and thought I’d drop a comment.

    Your wordpress site is very sleek – hope you don’t mind me asking what theme you’re using?
    (and don’t mind if I steal it? :P)

    I just launched my site –also built in wordpress like
    yours– but the theme slows (!) the site down quite a bit.

    In case you have a minute, you can find it by searching
    for “royal cbd” on Google (would appreciate any feedback) –
    it’s still in the works.

    Keep up the good work– and hope you all take care of yourself
    during the coronavirus scare!

  11. cbd hemp oil hemp hemp oil

    March 31, 2020 at 8:13 am

    Hello superb blog! Does running a blog like this require a large amount of work?
    I’ve very little expertise in computer programming but I had been hoping to start my own blog in the
    near future. Anyways, if you have any ideas or techniques for new blog owners please share.

    I know this is off subject however I just needed to ask.
    Thank you!

  12. Andrewtuh

    May 6, 2020 at 5:14 am

    best free webcam sites filipina cam sites.

  13. Andrewtuh

    May 6, 2020 at 9:47 am

    asian sex cam bestonlinesexwebcams korean sex cam.

  14. best cbd oil

    May 6, 2020 at 7:21 pm


  15. Lisahet

    May 6, 2020 at 9:30 pm

  16. cbd oil near me

    May 7, 2020 at 6:24 am

    Great goods from you, man. I’ve bear in mind your stuff prior to and you’re just extremely great. I really like what you’ve got here, really like what you are stating and the way in which through which you are saying it. You’re making it entertaining and you still take care of to keep it sensible. I can’t wait to learn far more from you. That is actually a tremendous website.|

  17. Kimhet

    May 7, 2020 at 10:54 am

  18. measismdigiree

    May 31, 2020 at 12:30 pm

    best cbd oil – cbd gummies cbd oil online cbd oil for sale

  19. exorkakaxalia

    May 31, 2020 at 12:39 pm

    cbd online cbd oil online cbd near me cbd online

  20. errocairm

    May 31, 2020 at 1:22 pm

  21. must have best products for weight loss

    May 31, 2020 at 1:47 pm

    Hi there i am kavin, its my first occasion to commenting anyplace, when i read this post i thought i could also make comment due to this sensible paragraph.|

  22. ToimaCleateTed

    June 4, 2020 at 10:47 am

    credit score range check credit score free credit karma com free credit score

  23. click the link

    June 16, 2020 at 5:38 pm

    nice blog

  24. Kimhet

    October 22, 2020 at 4:36 pm

Leave a Reply

Your email address will not be published.

Most Popular

To Top