Skip to main content

An Example of C++ Program


Structure of program


/*This Program prints Hello World on screen*/

#include <iostream.h>

using namespace std;

int main()

{

count << "Hello World";

return 0;

1 . /* This program ... */

The symbols/* and*/ used for comment. This Comments are ignored by the compiler, and are used to provide useful information about program to humans who use it.


2. #include <iostream.h>

This is a preprocessor command which tells compiler to include iostream.h file.


3. using namespace std; 

All the elements of the standard C++ library are declared within what is called a namespace, the namespace with the name std. So in order to access its functionality we declare with this expression that we will be using these entities. This line is very frequent in C++ programs that use the standard library.


4. main()

C++ programs consist of one or more functions. There must be one and only one function called main. The brackets following the word main indicate that it is a function and not a variable.


5. { }

braces surround the body of the function, which may have one or more instructions/statements.


6. Cout<<

it is a library function that is used to print data on the user screen.


7. ''Hello World'' is a string that will be displayed on user screen 


8. ; a semicolon ends a statement.


9. return 0; return the value zero to the Operating system. 




Comments

Popular posts from this blog

How To install Kali Linux (nethunter) On Android (Without root) via proot-distro and install Kali Linux Xfce Desktop On Android using Termux

What is kali linux? Kali Linux is a Debian-derived Linux distribution designed for digital forensics and penetration testing. It is maintained and funded by Offensive Security , This tutorial isn't only about learning how to install Kali Linux. Okay let's run down what we will be doing                        Table Of Content •Installing Kali Linux Terminal •Installing Kali Linux Desktop •Installing Default packages  •Creating vncserver port •Closing vncserver port •Closing multiple vncserver ports  •Reseting Kali Linux •Uninstalling Kali Linux  Okay!!!! Let's Begin Requirements: • Termux  : Click Here To Download Termux   Installation:   Please you can also copy and paste the commands below    The First thing we have to do is to make sure our repositories are up to date, to do that type the command  pkg update   It is essent...

How To install Windows 10 in Termux(Without rooting your Android phone)

   Hello guys what's up, Today we are going to see how easily we can run Windows 10 Operating System on Android Phone just by running few commands on Termux and if you will like this post I will also show you how to run the Windows 8.1 and Kali Linux GUI(Without root) on Android using Termux only in an upcoming post so just comment down below if you are interested. This method is quite interesting as this will make you understand how powerful a Linux terminal can be so without wasting any more time let’s start this tutorial. Below you will find all the resources you need and their download links so Download all the files, install, and copy it to your smartphone's Internal or External Storage. Requirements: •ZArchiver : Click Here To Download ZArchiver • Termux  : Click Here To Download Termux • AVNC :  Click Here To Download AVNC • Windows 10 : Click Here To Download The Windows 10 File After download the windows 10 file you need to Install termux and AVNC server...

Geegpay Writing Challenge: The Story of Amina

  Geegpay Writing Challenge Prompt: Life throws us lemons, and sometimes it's hard to make lemonade out of them. Amina, a 25-year-old aspiring photographer, is struggling to make ends meet while juggling freelance gigs and caring for her ageing mother. She feels invisible, undervalued, and on the verge of giving up. But then, an unexpected encounter with a renowned artist reignites her passion and inspires her to take control of her own narrative. Write a 300-word short story from Amina's perspective, showing her journey from despair to determination. Write about the challenges she faces, the things she learns about herself and how she finds the strength to turn things around.     Life throws us lemons, and sometimes it's hard to make lemonade out of them. My Story Starts Here:   Amina was walking down a crowded street with a heavy bag of cameras on her shoulder and a lot on her mind. 25 years old, she was feeling crushed by the pressures of life. She was struggling...