update
This commit is contained in:
19
DEV.1.1/salut.c
Normal file
19
DEV.1.1/salut.c
Normal 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;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user