Volume of Add Operator: Create 2 Simple Mathematical Operator Function Using C++ Programming Language Software
Volume of Add Operator: Create 2 Simple Mathematical Operator Function Using C++ Programming Language Software
Muhd Afiq
#include <iostream>
This specific file includes the declarations of the basic standard input output library
in C++ and is included because its functionality will be used later in the program.
#include <stdlib.h>
This specific file includes the declarations of the standard library in C++ and is
included to access the standard library in the program.
All elements of the standard C++ library are declared within a namespace, the
namespace with the name std.
int main ()
Muhd Afiq
This is the point where all C++ programs start their execution. The pair of
parentheses ( () ) are used to include parameters within them. Followed by int main
() are a pair of braces ({}) which encloses the body of the main function.
int ;
std::cout<<
This line is a C++ statement and is a visible effect in the program. \n is used to
make a new line after the statement or before if placed in front.
std::cin>>
Total = A+B;
system (PAUSE);
This will pause the program after execution is done, allowing users to see the results.
return 0;
Muhd Afiq
#include <iostream>
This specific file includes the declarations of the basic standard input output library
in C++ and is included because its functionality will be used later in the program.
#include <stdlib.h>
This specific file includes the declarations of the standard library in C++ and is
included to access the standard library in the program.
All elements of the standard C++ library are declared within a namespace, the
namespace with the name std.
Muhd Afiq
int main ()
This is the point where all C++ programs start their execution. The pair of
parentheses ( () ) are used to include parameters within them. Followed by int main
() are a pair of braces ({}) which encloses the body of the main function.
int A,B,Volume;
std::cout<<
This line is a C++ statement and is a visible effect in the program. \n is used to
make a new line after the statement or before if placed in front.
std::cin>>
Volume = A*B
The symbol * will multiply the variables A,B, and will be the variable to output as
Volume.
system (PAUSE);
This will pause the program after execution is done, allowing users to see the results.
return 0;
Muhd Afiq
2. Click the tab file and then select New Source File.
Muhd Afiq
Muhd Afiq
4. Compile the project by clicking the Execute tab and choosing Compile and run or
just press F11.
5. Save the file with respective names corresponding to the function of the program.
Muhd Afiq
7. The program will then run automatically. A command prompt screen will appear .
Muhd Afiq
Muhd Afiq