Udechukwu David Chibuikem
23/0161
Software Engineering Group E
Number 1
#include <iostream>
using namespace std;
int addTwoNumbers(int a, int b) {
return a + b;
int multiplyThreeNumbers(int x, int y, int z) {
return x * y * z;
double calculateAverage() {
double num1, num2, num3;
cout << "Enter three numbers: ";
cin >> num1 >> num2 >> num3;
return (num1 + num2 + num3) / 3.0;
int main() {
int a, b, x, y, z;
cout << "Enter two numbers to add: ";
cin >> a >> b;
cout << "Sum: " << addTwoNumbers(a, b) << endl;
cout << "Enter three numbers to multiply: ";
cin >> x >> y >> z;
cout << "Product: " << multiplyThreeNumbers(x, y, z) << endl;
cout << "Average: " << calculateAverage() << endl;
return 0;
Number 2
#include <iostream>
Using namespace std;
Bool detectEven(int n) {
Return (n % 2 == 0);
Bool detectOdd(int n) {
Return (n % 2 != 0);
Int summation(int n) {
Int sum = 0;
For (int i = 1; i <= n; i++) {
Sum += i;
Return sum;
Int main() {
Int n;
Cout << “Enter a number: “;
Cin >> n;
If (detectEven(n)) {
Cout << n << “ is an even number.” << endl;
} else {
Cout << n << “ is an odd number.” << endl;
}
Cout << “Summation from 1 to “ << n << “ is: “ << summation(n) <<
endl;
Return 0;
Int main() {
return yourmain();