小编Joh*_*651的帖子

查找大于和小于数组中的数字

#include <stdio.h>
#define SIZE 10
void function(int array[], int size, int compare, int* min, int* max);

int main() {
    int max1, min1, n, m, array1[SIZE];
    printf("Please enter an array size: ");
    scanf("%d", &n);
    printf("Enter numbers for array:");
    for (int i = 0; i < n; i++) {
        printf("enter number %d", i + 1);
        scanf("%d", &array1[i]);
    }
    printf("Enter a number to be compared:");
    scanf("%d", &m);
    function(array1, n, m, &min1, &max1);
    printf("There are %d numbers less than %d and there are %d …
Run Code Online (Sandbox Code Playgroud)

c pass-by-reference

4
推荐指数
1
解决办法
64
查看次数

标签 统计

c ×1

pass-by-reference ×1