Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Passing Arguments | Functions
C Basics
course content

Зміст курсу

C Basics

C Basics

1. Introduction
2. Data
3. Operators
4. Control Statements
5. Functions
6. Pointers

Passing Arguments

Finding the Maximum Element in an Array

c

main

copy
123456789101112131415161718192021222324252627
#include <stdio.h> int findMaxElement(int arr[]) // 1 { int max = arr[0]; // 2 for (int i = 1; i < 5; i++) // 3 { if (arr[i] > max) // 3 { max = arr[i]; // 4 } } return max; } int main() { int array[] = { 10, 5, 7, 14, 3 }; int maxElement = findMaxElement(array); printf("Max element is: %d\n", maxElement); return 0; }

Завдання

Craft a function that determines the smallest element of an array.

Завдання

Craft a function that determines the smallest element of an array.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів

Все було зрозуміло?

Секція 5. Розділ 4
toggle bottom row

Passing Arguments

Finding the Maximum Element in an Array

c

main

copy
123456789101112131415161718192021222324252627
#include <stdio.h> int findMaxElement(int arr[]) // 1 { int max = arr[0]; // 2 for (int i = 1; i < 5; i++) // 3 { if (arr[i] > max) // 3 { max = arr[i]; // 4 } } return max; } int main() { int array[] = { 10, 5, 7, 14, 3 }; int maxElement = findMaxElement(array); printf("Max element is: %d\n", maxElement); return 0; }

Завдання

Craft a function that determines the smallest element of an array.

Завдання

Craft a function that determines the smallest element of an array.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів

Все було зрозуміло?

Секція 5. Розділ 4
toggle bottom row

Passing Arguments

Finding the Maximum Element in an Array

c

main

copy
123456789101112131415161718192021222324252627
#include <stdio.h> int findMaxElement(int arr[]) // 1 { int max = arr[0]; // 2 for (int i = 1; i < 5; i++) // 3 { if (arr[i] > max) // 3 { max = arr[i]; // 4 } } return max; } int main() { int array[] = { 10, 5, 7, 14, 3 }; int maxElement = findMaxElement(array); printf("Max element is: %d\n", maxElement); return 0; }

Завдання

Craft a function that determines the smallest element of an array.

Завдання

Craft a function that determines the smallest element of an array.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів

Все було зрозуміло?

Finding the Maximum Element in an Array

c

main

copy
123456789101112131415161718192021222324252627
#include <stdio.h> int findMaxElement(int arr[]) // 1 { int max = arr[0]; // 2 for (int i = 1; i < 5; i++) // 3 { if (arr[i] > max) // 3 { max = arr[i]; // 4 } } return max; } int main() { int array[] = { 10, 5, 7, 14, 3 }; int maxElement = findMaxElement(array); printf("Max element is: %d\n", maxElement); return 0; }

Завдання

Craft a function that determines the smallest element of an array.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Секція 5. Розділ 4
Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
We're sorry to hear that something went wrong. What happened?
some-alt