Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //main.cpp
- #include <iostream>
- #include "../head/io.h"
- using namespace std;
- int main()
- {
- int first=readNumber();
- int second=readNumber();
- writeAnswer(first+second);
- return 0;
- }
- //io.cpp
- #include <iostream>
- using namespace std;
- void writeAnswer(int result)
- {
- cout << "Result: " << result << endl;
- }
- int readNumber()
- {
- int number;
- cout << "Enter a number: ";
- cin >> number;
- return number;
- }
- //io.h
- #ifndef IO_H
- #define IO_H
- void writeAnswer(int);
- int readNumber();
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement