19 lines
414 B
C
19 lines
414 B
C
#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;
|
|
}
|
|
} |