init projet
This commit is contained in:
15
tp1/Sources-TD1/Exercice4.c
Normal file
15
tp1/Sources-TD1/Exercice4.c
Normal file
@@ -0,0 +1,15 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(void) {
|
||||
int a = 1, b = 2, c = 3, d = 4;
|
||||
int *p1 = &a, *p2 = &b, *p3 = &c, *p4 = &d, *p5;
|
||||
|
||||
p5 = p3;
|
||||
*p3 = *p2;
|
||||
*p2 = *p5;
|
||||
*p4 = *p1;
|
||||
*p1 = *p4;
|
||||
printf("a, b ,c and d are equal to: %d, %d, %d and %d\n", a, b, c, d);
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
Reference in New Issue
Block a user