First C++ program
In this tutorial, we will learn how programs are writte in the C++ language. And how they are compile and run.
You open the software where you write a program as turboC++ and write the code which are as...
We can use other object for this program which are as..
[Write a program that display a message (Hello word) on to the screen.]
#include<iostream.h>
#include<conio.h>
Int main()
{
clrscr();
cout<<"\n Hello,welcome to computer zone.";
cout<<"\n My name is Harsh Chauhan.";
cout<<"\n this is my first program of C++ language.";
return (0);
return (0);
getch();
}
Output:
Parts of a C++ program
#include statement (preprocessor)
Int main() (function)
Variable
Printf (library function)
getch() or return(0) (terminates the main() and return the value)
{} (use on start and end of function)
Description of above parts
#include<iostream.h>
Include is a standard I/O library function.It is a preprocessor.It is tells to compiler add <iostream.h> file before actual compilation.
int main()
Void main() or int main() is a main part of a program.It is a function. Void main() is the entry part of every C++ program.
{
This symbol is use after the main() function because the exicuation of every program is started here.It is use on start of function.
Variable
Variable is the name of a memory location where the data are stored.In this place we declare the variables.
cout
Cout is a library function in C++ language. It is used for print the data on the screen(console).
Getch() or return(0)
It is use for return the value.
}
This symbol is use after the getch() and return(0) because the exicuation of every program is end here.It is use on end of function.
Please share this post and blog link with your friends.For more programs use this blog.
If you have any problem, please comment in comment box, subscribe this blog for notifications of new post on your email and follow this blog.
Created by-- HARSH CHAUHAN
No comments:
Post a Comment