Informatics3-2024/Homework1
A MathWikiből
Send an email with the solutions as attachments (.c, .cpp or if you have .h and .hpp files) to the following email address: tofihomework+2024info3en@gmail.com
You shouldn't attach the compiled programs. If you feel like you're sending a lot of files (5+) you can put them in a zip, but you don't need to.
Minmax
Write a function named minmax that finds the smallest and largest element of a given float array. It returns both of them through pointers.
You can use this small frame for testing (you'll need to replace the question marks with something):
#include<stdio.h> void minmax(?, ?, ?, ?) { } int main(void) { float t[] = {-3.4, -3.4, 9.3, 6.2, 4.9, 5.3, -9.9, -1.5, 9.7, -5.8}; minmax(t, 10, ?, ?); // need 2 variables to store the min and max values printf("%f\n%f\n", ?, ?); return 0; }