2.x Quiz
This commit is contained in:
parent
9bf81f1adc
commit
b21c717fdd
4 changed files with 24 additions and 12 deletions
14
main.cpp
14
main.cpp
|
@ -1,17 +1,11 @@
|
|||
#include <iostream> // for std::cout
|
||||
|
||||
// Definition of user-defined function doPrint()
|
||||
void doPrint() // doPrint() is the called function in this example
|
||||
{
|
||||
std::cout << "In doPrint()\n";
|
||||
}
|
||||
#include "io.h"
|
||||
|
||||
// Definition of function main()
|
||||
int main()
|
||||
{
|
||||
std::cout << "Starting main()\n";
|
||||
doPrint(); // Interrupt main() by making a function call to doPrint(). main() is the caller.
|
||||
std::cout << "Ending main()\n"; // this statement is executed after doPrint() ends
|
||||
|
||||
int a{readNumber()};
|
||||
int b{readNumber()};
|
||||
writeAnswer(a + b);
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue