-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtableau.c
More file actions
45 lines (38 loc) · 749 Bytes
/
Copy pathtableau.c
File metadata and controls
45 lines (38 loc) · 749 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include <stdio.h>
int simple(void) {
float notes[3] = {14.2, 15.6, 19};
for (int i = 0; i < 3; i++)
{
printf("La note est : %f\n", notes[i]);
}
return 0;
}
int multiple(void)
{
int nombres[2][3] = {{4, 2, 3}, {9, 7, 6}};
for (int i = 0; i < 2; i++)
{
for (int j = 0; j < 3; j++)
{
printf("%d ", nombres[i][j]);
}
printf("\n");
}
return 0;
}
int main(void)
{
int choice;
printf("Choisir un programme entre 1 et 2...\n");
printf("1 - Tableau simple\n");
printf("2 - Tableau multiple\n");
printf(">> ");
scanf("%d", &choice);
if (choice == 1)
{
simple();
} else if (choice == 2)
{
multiple();
}
}