Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Apprendre Passage d'Arguments | Fonctions
Bases Du C

bookPassage d'Arguments

Recherche de l’élément maximal dans un tableau

main.c

main.c

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; }
Tâche

Swipe to start coding

Créer une fonction qui détermine l'élément le plus petit d'un tableau.

Solution

Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 5. Chapitre 4
single

single

Demandez à l'IA

expand

Demandez à l'IA

ChatGPT

Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion

close

Awesome!

Completion rate improved to 2.63

bookPassage d'Arguments

Glissez pour afficher le menu

Recherche de l’élément maximal dans un tableau

main.c

main.c

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; }
Tâche

Swipe to start coding

Créer une fonction qui détermine l'élément le plus petit d'un tableau.

Solution

Switch to desktopPassez à un bureau pour une pratique réelleContinuez d'où vous êtes en utilisant l'une des options ci-dessous
Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 5. Chapitre 4
single

single

some-alt