It works but the output is broken :)

This commit is contained in:
2024-03-21 17:08:36 -05:00
parent 39b0da17b9
commit 118d95a69d
219 changed files with 7927 additions and 0 deletions

View File

@@ -0,0 +1,48 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/cppFiles/class.cc to edit this template
*/
/*
* File: arrays.cpp
* Author: caleb
*
* Created on March 1, 2024, 11:11AM
*/
#include <iostream>
using namespace std;
#include "arrays.h"
void initializeArray (int arr[], const int size) {
for (int i = 0; i < size; ++i) {
arr[i] = i+10;
}
}
void printArray(int arr[], const int size) {
for (int i = 0; i < size; ++i) {
cout << arr[i] << " ";
}
cout << endl;
}
int& returnAddressOfFirstElementOfArray (int arr[3]) {
return arr[0];
}
int findMaxAndMin(int arr[2][3], int & min) {
int max = arr[0][0];
min = arr[0][0];
for (int i = 0; i < 2; ++i) {
for (int j = 0; j < 3; ++j) {
if (min > arr[i][j]) {
min = arr[i][j];
}
if (max < arr[i][j]) {
max = arr[i][j];
}
}
}
return max;
}