Professional Documents
Culture Documents
Problem Solution
Flow line
Decision
Terminal
(start/end)
Process Input/Output
#include <iostream>
using namespace std;
int main()
{
cout << “Hello world”;
return 0;
}
3. Producing a computer program
• Translation of a program into binary is important
• A computer understands only the language of 1s and 0s
Example: Computing sum of 3 numbers
1. Acquire 1st number
2. Store the number in variable x
3. Acquire 2nd number
4. Store the number in variable y
5. Add x and y
6. Store the result in variable sum1
7. Acquire 3rd number
8. Store the number in variable z
9. Add sum1 and z This is not an efficient
algorithm, though.
10. Store the result of addition in variable sum2 Can you write a better
11. Show the sum2 as result one?