à®®ேலுà®®் பல புதிய டெக்னாலஜி பற்à®±ி தெà®°ிந்து கொள்ள, எங்கள் "டெக் டுப் தமிà®´் நாடு" யூட் டூஃப் சேனலை SUBSCRIBE செய்து கொள்ளவுà®®்.

Breaking

Thursday 6 July 2017

Structure of C++ Program

Structure of C++ Program

Every C++ program can be written with the following syntax.

Syntax

#include<headerfilename.h>  --> include section

class class_name
{
data members;
user defined method;
{
..........
..........
}
};

returntype main()  --> main method
{
.........
.........
}

Include section

# include is a pre-processor directive can be used to include all the predefined method of given header files into current C program before compilation.

Syntax

#include<headerfile.h>

class

Class is a blue print which is containing only list of variables and method.
C++ library is collection of header files, header files is a container which is collection of related predefined method.

User defined method section

If any method is defined by the user is known as user defined method. Method is collection of statement used to perform a specific Operation.

Syntax

returntype method_name()
{
.......
.......
}
In the above syntax method name can be any user defined name, return type represents which type of value it can return to its calling method.

Syntax

methodName(); // calling method
Note: User defined method are Optional in a C++ program.

Main() method

This is starting executable block of any program (it is always executed by processor and OS ). One C++ program can have maximum one main() the entire statements of given program can be executed through main(). Without main() method no C++ program will be executed.

Syntax

returntype main()
{
......
.....
}
If return type is void that method can not return any value to the operating system. So that void can be treated as no return type.

Example

#include<iostream.h>
#include<conio.h>

void main()
{
cout<<("Hello main";
}

Output

Hello main

IO statements in C++

IO represents input output statements, and input statement can be used to read the input value from the standard input device (keyboard), output statement can be used to display the output in standard output device (Monitor) respectively. In C++ language IO statement can be achieve by using cout<< and >>cin.

No comments:

Post a Comment

Hai , Post your comment . (required, Bugs, Errors )

You need to see


SUBSCRIBE NOW



Backlinks : Website Design Company in Coimbatore
Website Design Company in Tamil nadu
Website Design Company in Karur
Website Design Company in Erode
Website Design Company in ooty
Website Design Company in theni
Website Design Company in thoothukudi
Website Design Company in Chennai
Website Design Company in Sathy
Website Design Company in Coimbatore Tamilnadu
Cheap Website Design Company in Coimbatore
Adsense Website Design Company in Coimbatore
ecommerce Website Design Company in Coimbatore
school Website Design Company in Coimbatore
Academy Website Design Company in Coimbatore
Test Website Design Company in Coimbatore
Best Website Design Company in Coimbatore
Adsense Website Design Company in Coimbatore
Adsense Website Design Company in Tamil nadu
Adsense Website Design Company in Karur
Adsense Website Design Company in Erode
Adsense Website Design Company in ooty
Adsense Website Design Company in theni
Adsense Website Design Company in thoothukudi
Adsense Website Design Company in Chennai
Adsense Website Design Company in Sathy
Free SEO Tools online
Free SEO Tools online Website
Free SEO Tools online Plagiarism
Free SEO Tools online article rewriter tool
Free SEO Tools online article reading and writing criticism
Free SEO Tools online seo backlink
Free SEO Tools online Free backlink maker
Free SEO Tools online seo backlink strategy
Free SEO Tools online content writting
360 help SEO Tools online Plagiarism checker
360 help SEO Tools online seo backlink
360 help SEO Tools online Free backlink maker
360 help SEO Tools online content writting
360 help SEO Tools online article rewriter tool
360 help SEO Tools
360 help SEO Tools India
360 help SEO Tools Tamil
360 help SEO Tools website