0% found this document useful (0 votes)
46 views

Programing: A. Create 2 Simple Mathematic Operator Function Using C++ Programming Language Software

The document describes how to create and run a simple C++ program that performs mathematical operations. It includes: 1) Creating two functions - one for multiplication and one for division 2) Explaining the key aspects of the C++ code used like headers, main function, output streams 3) A step-by-step process for running the program that includes opening a C++ editor, writing code for division, running and executing the program, and viewing the output

Uploaded by

faridkhirzam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views

Programing: A. Create 2 Simple Mathematic Operator Function Using C++ Programming Language Software

The document describes how to create and run a simple C++ program that performs mathematical operations. It includes: 1) Creating two functions - one for multiplication and one for division 2) Explaining the key aspects of the C++ code used like headers, main function, output streams 3) A step-by-step process for running the program that includes opening a C++ editor, writing code for division, running and executing the program, and viewing the output

Uploaded by

faridkhirzam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

PROGRAMING

a. Create 2 simple Mathematic operator function using C++ programming language


software.
- first simple Mathematic is Multiply

- Second simple Mathematic is divider

b. Explain programing C++ that you create (operation)


I.
II.
III.
IV.
V.

# = A hash sign (#) are directives for the pre-processor.


#include = The directive #include tells the pre-processor to include a standard file.
iostream.h = Header that defines the standard input/output stream objects and used
for cout.
Int main() = The main function is the point by where all C++ programs start their
execution, independently of its location within the source code.
cout = The standard output, normally the screen.

VI.

<< = The bitwise left shift (<<) shifts operator bits to the left.

VII.

Hello World\n"; = In fact, this statement performs the only action that generates a
visible effect in our first program. A statement is a simple or compound expression
that can actually produce some effect.
\n = (new line) Moves the active position to the initial
position of the next line.
= the separation between statements is specified with an ending semicolon (;) at the
end of each one, so the separation in different code lines does not matter at all for this
purpose.
return 0; = The return statement causes the main function to finish

VIII.
IX.

X.

c. Give your answer step by step how to Run that Program.


1. Open Programming C++

2. Select new source file

3. Write this program


#include <iostream>
#include <stdlib.h>

int main()
{
int m, n, total;
std::cout <<"\n Masuk nilai m:";
std::cin >> m;
std::cout <<"\n masuk nilai n:";
std::cin >> n;

total= m/n;

std::cout <<"\n nilai m/n ialah =" << total;

system("PAUSE");
return 0;
}

4. Run the project

5. Save the file under project 3

6. Compilation process

7. Excute the program

8. Insert the data

9 Result

You might also like