0% found this document useful (0 votes)
30 views2 pages

OOP1

The document outlines the typical sequence of a C++ program: 1) Preprocessor directives like #include and #define are used to include header files and define constants. 2) Constants like const float are declared. 3) Global variables that can be accessed across functions are declared. 4) Function prototypes declare functions that will be defined and called later. 5) The main() function contains the primary program logic and calls other functions. 6) Functions are defined with a return type, name, and parameters to implement the actual logic.

Uploaded by

api-3701035
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views2 pages

OOP1

The document outlines the typical sequence of a C++ program: 1) Preprocessor directives like #include and #define are used to include header files and define constants. 2) Constants like const float are declared. 3) Global variables that can be accessed across functions are declared. 4) Function prototypes declare functions that will be defined and called later. 5) The main() function contains the primary program logic and calls other functions. 6) Functions are defined with a return type, name, and parameters to implement the actual logic.

Uploaded by

api-3701035
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

1

C++ Program
Sequence
1)Preprocessor Directive:
#include< >
For Example:
#include<iostream.h>
#include<conio.h>
#include<math.h>
/*#include is a key word and
iostream.h, conio.h, math.h are header files.*/
#define /*Constant*/
For Example:
#define p=3.1415
/* #define is a key word use to define constant
and p is any constant number have value
3.1415.*/
2)Name Constant:
For Example:
const float p=3.1415;
/*const is key word, float is the data type of
const and p is a constant number having value
3.1415.*/
3) Global Variable:
/* A Global Variable is the variable which use
more then one Functions or Sub Program.*/
For Example:
int a;
/* int is the type of variable and a is the name
of variable*/
4)Function Proto-Typing.

DESIGN BY ZAKIR KHAN


[email protected] www.zakir.co.nr
2

For Example:
float area(float r);
/* area is a function which carry the value of a
float type variable name r and return back a
value of float type*/
5)main( )
/* main is the main function which called
automatically */
{
variable declaration;
other executable statement
:
:
:
:
return statement;
}
/* inside the { } there will be the a program
which works according to our designing.*/
6)Function definition:
For Example:
type name(variable)
{
Body of function
}
/* Definition contain name type and the variable
which shifted from main function and then
working and logic of function after then return
the value.*/

DESIGN BY ZAKIR KHAN


[email protected] www.zakir.co.nr

You might also like