Program flow
- Define the goal.
Read two numbers and print the result.
- Write the requirements.
The user enters two numbers.
The program calculates the result.
The program prints the result.
- Break the problem into parts.
- read first number
- read second number
- calculate result
- print result
- Turn parts into functions.
readNumber();
calculateResult();
printResult();
- Decide the flow.
input -> calculation -> output
- Start with
main().
int main()
{
return 0;
}
- Implement one piece at a time.
prototype -> body -> test