#include <iostream>
using namespace std;

//void myFunction(string country = "Norway") {
//	cout << country << "\n";
//}
//
//int myFunction(int x, int y) {
//	cout << x + y << "\n";
//	return x + y;
//}

//void swapNums(int x, int y) {
//	int z = x;
//	x = y;
//	y = z;
//}

void printArray(int arr[], int size) {
	for (int i = 0; i < size; i++) {
		cout << arr[i] << " ";
	}
	cout << "\n";
}

//int sumFrom1toN(int n) {
//	if (n == 1) {
//		return 1;
//	}
//	else {
//		return n + sumFrom1toN(n - 1);
//	}
//}
int main() {
	//myFunction("Sweden");
	//myFunction("India");
	//myFunction();
	//myFunction("USA");

	//myFunction(10, 20);

	//..................pass by reference..........................//

	//int firstNum = 10;
	//int secondNum = 20;

	//cout << "Before swap: " << "\n";
	//cout << firstNum<< " " << secondNum << "\n";

	//swapNums(firstNum, secondNum);

	//cout << "After swap: " << "\n";
	//cout << firstNum << " " << secondNum << "\n";

	//..................pass Array..........................//

	// how to pass an array to a function in C++? ...................................................... You can pass an array to a function by specifying the name of the array without any square brackets. The function will receive a pointer to the first element of the array.



	int myNumbers[5] = { 10, 20, 30, 40, 50 };
	printArray(myNumbers, 5);

	//...................recursion..........................//

	//int result = 1;
	//result = sumFrom1toN(5);
	//cout << "The sum from 1 to 5 is: " << result << "\n";

	//// Search for recursion on google ...

	return 0;
}