Checkrite Shopping @OMORTUNDEY Freelance Multi-Level Ventures

Checkrite Shopping @OMORTUNDEY Freelance Multi-Level Ventures
.......................We provide for all your need..................

Search here for your purpose

Translate to view in your language

CHECK YOUR DAILY CALENDAR HERE

O.F.M.V PERPETUAL CALENDAR

Perpetual Calender






Wednesday, December 18, 2019

Hello World – First C++ Program

In this guide we will write and understand the first program in C++ programming. We are writing a simple C++ program that prints “Hello World!” message. Lets see the program first and then we will discuss each and every part of it in detail.

Hello World Program in C++

/*
* Multiple line
* comment
*/
#include<iostream>

//Single line comment
using namespace std;

//This is where the execution of program begins
int main()
{
   // displays Hello World! on screen
   cout<<"Hello World!";

   return 0;
}
Output:
Hello World!
Let’s discuss each and every part of the above program.
1. Comments – You can see two types of comments in the above program
// This is a single line comment
/* This is a multiple line comment
* suitable for long comments
*/
Comments as the names suggests are just a text written by programmer during code development. Comment doesn’t affect your program logic in any way, you can write whatever you want in comments but it should be related to the code and have some meaning so that when someone else look into your code, the person should understand what you did in the code by just reading your comment.
For example:
/* This function adds two integer numbers 
 * and returns the result as an integer value
 */
int sum(int num1, int num2) {
   return num1+num2;
}
Now if someone reads my comment he or she can understand what I did there just by reading my comment. This improves readability of your code and when you are working on a project with your team mates, this becomes essential aspect.
2. #include<iostream> – This statements tells the compiler to include iostream file. This file contains pre defined input/output functions that we can use in our program.
3. using namespace std; – A namespace is like a region, where we have functions, variables etc and their scope is limited to that particular region. Here std is a namespace name, this tells the compiler to look into that particular region for all the variables, functions, etc. I will not discuss this in detail here as it may confuse you. I have covered this topic in a separate tutorial with examples. Just follow the tutorial in the given sequence and you would be fine.
4. int main() – As the name suggests this is the main function of our program and the execution of program begins with this function, the int here is the return type which indicates to the compiler that this function will return a integer value. That is the main reason we have a return 0 statement at the end of main function.
5. cout << “Hello World!”; – The cout object belongs to the iostream file and the purpose of this object is to display the content between double quotes as it is on the screen. This object can also display the value of variables on screen(don’t worry, we will see that in the coming tutorials).
6. return 0; – This statement returns value 0 from the main() function which indicates that the execution of main function is successful. The value 1 represents failed execution.


WHAT DO YOU THINK? - We have all sinned and deserve God's judgment. God, the Father, sent His only Son to satisfy that judgment for those who believe in Him. Jesus, the creator and eternal Son of God, who lived a sinless life, loves us so much that He died for our sins, taking the punishment that we deserve, was buried, and rose from the dead according to the Bible. If you truly believe and trust this in your heart, receiving Jesus alone as your Savior, declaring, "Jesus is Lord," you will be saved from judgement, and spend eternity with God in heaven.

What is your response?
Yes, today, I'm deciding to follow Jesus


Yes, I'm already the follower of Jesus.



If you would like to donate to Ykamazingworld please click here

Check for more updates on Ykamazingworld Business List.

To meet your needs with Ykamazingworld click on: http://metyourneeds.blogspot.com/  
[Home Page] [Met your needs] [About Ykamazingworld Nigeria Enterprises][Footwear and Leather Production][Computer & Businesses] [Media and Communication Studios] [Films and Theatre Production Studios] [Vegetable Oil Dealer] [Home Planning & Building Engineer] (Farm FoodProduction) (Fashion, Wears and Printing Production) (Home-made and Cosmetics) (Ice-block Depot, Drinks, Provision and Business Ventures[Ykamazingworld Search][Carrier and Opportunity] [Company Overview] [Our Objectives] [Our Vision] [Our Goals] [Our Products] [Our Services] [Networking & Communications] [Consultancy] [Sales of Footwear and Leather Suppliers][Computer Industrial Training (I.C.T)] [Footwear Industrial Training (F.I.T)] [Payment Rules and Regulation] [Sponsors or Fund Raising] [Ykamazingworld Proposals(for Partnerships)] [Ykamazingworld Banks & Accounts] [Social Media] [Our Address] [Our Contacts] [Ykamazingworld Weblinks][GOto Blog] [GOto WebChatrooms] [GOto Books and Publishing] [GOto Word of Wisdom] [GOto Answers.com] [Notice for all our Clients]

Together, we rise to the future. . .






No comments:

Post a Comment

Copyright 2006 - 2020 @YKAMAZINGWORLD NIGERIA ENTERPRISES.yes