diff options
1 files changed, 34 insertions, 0 deletions
| -rw-r--r-- | pract_SI/Pract. 04/Solutions/task1.cpp | 34 |
diff --git a/pract_SI/Pract. 04/Solutions/task1.cpp b/pract_SI/Pract. 04/Solutions/task1.cpp new file mode 100644 index 0000000..3e8c1a3 --- /dev/null +++ b/pract_SI/Pract. 04/Solutions/task1.cpp @@ -0,0 +1,34 @@ +#include <iostream> + +using namespace std; + +int sum(const int a, const int b) +{ + /* + //First way + int sum = a + b; + return sum; + */ + + //Second way + return a + b; +} + +int main() +{ + int num1, num2; + cin >> num1 >> num2; + + //First way + cout << sum(num1, num2) << endl; //return as output on Console + + /* + //Second way + //int sumOfNumbers = sum(num1, num2); //create an int with value num1+num2; + //cout << sumOfNumbers << endl; + */ + + return 0; +} + + |
