Search Header Logo

Quiz sur les tableaux en C

Authored by Hamza Bouchikhi

Other

Professional Development

Used 4+ times

Quiz sur les tableaux en C
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Comment accède-t-on au dernier élément d'un tableau arr en C de taille n ?

arr[n-1]

arr[n]

arr[n-2]

arr[0]

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Quelle est la syntaxe correcte pour déclarer une fonction qui retourne un tableau en C ?

int* function_name();

int[] function_name();

int function_name[]();

int function_name(int[]);

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Quelle est la sortie du code suivant ? int arr[] = {2, 4, 6, 8}; printf("%d", arr[1] * arr[3]);

8

16

32

24

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Quelle est la valeur de i après l'exécution de cette boucle ? int i = 0; for (i = 1; i < 5; i++) {}

5

4

6

1

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Comment parcourt-on correctement un tableau avec une boucle en C ?

for (int i = 0; i < n; i++) { /* code */ }

for (int i = 1; i <= n; i++) { /* code */ }

for (int i = 0; i <= n; i++) { /* code */ }

for (int i = 1; i < n; i++) { /* code */ }

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Quel est le résultat du code suivant ? int arr[] = {1, 2, 3}; printf("%d", arr[1] + arr[2]);

5

3

6

4

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Quel sera la sortie du code suivant ? int arr[] = {1, 2, 3, 4, 5}; int sum = 0; for (int i = 0; i < 5; i++) { sum += arr[i]; } printf("%d", sum);

10

15

5

20

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?