This commit is contained in:
Emmanuel Srivastava
2024-12-02 13:59:14 +01:00
parent 851ce813f7
commit de45003c53
9 changed files with 232 additions and 0 deletions

19
DEV.1.1/salut.c Normal file
View File

@@ -0,0 +1,19 @@
#include <stdio.h>
#include <stdlib.h>
int main(void) {
int* p = NULL;
p = (int*) malloc(2*sizeof(int));
if (p) {
printf("Entrez un entier : ");
scanf("%d", p);
printf("Entrez un second entier : ");
scanf("%d", p + 1);
printf("Leur somme vaut %d.\n", p[0] + p[1]);
free(p);
return EXIT_SUCCESS;
} else {
puts("Espace mémoire insuffisant !");
return EXIT_FAILURE;
}
}