diff --git a/TP5/TD5 – Tableaux (suite) et Fichiers.pdf b/TP5/TD5 – Tableaux (suite) et Fichiers.pdf new file mode 100644 index 0000000..ebd21ca Binary files /dev/null and b/TP5/TD5 – Tableaux (suite) et Fichiers.pdf differ diff --git a/TP5/data.dat b/TP5/data.dat new file mode 100644 index 0000000..b48ac4b --- /dev/null +++ b/TP5/data.dat @@ -0,0 +1 @@ +1.000000 1 diff --git a/TP5/fileread.c b/TP5/fileread.c new file mode 100644 index 0000000..41165c2 --- /dev/null +++ b/TP5/fileread.c @@ -0,0 +1,16 @@ +#include + +int main () { + +float a = 1.; +int b = 1 ; + +FILE *point = fopen("data.dat","r"); + + fscanf(point,"%f %d \n",&a,&b); + + printf("%f %d \n",a,b); + + fclose(point); + + } diff --git a/TP5/filewrite.c b/TP5/filewrite.c new file mode 100644 index 0000000..9e55c00 --- /dev/null +++ b/TP5/filewrite.c @@ -0,0 +1,14 @@ +#include + +int main () { + +float a = 1.; +int b = 1 ; + +FILE *point = fopen("data.dat","w"); + + fprintf(point,"%f %d \n",a,b); + + fclose(point); + + } diff --git a/TP5/tableau2D.c b/TP5/tableau2D.c new file mode 100644 index 0000000..351372b --- /dev/null +++ b/TP5/tableau2D.c @@ -0,0 +1,24 @@ + +#include + +#define N 5 + + + +int main () { + +float A[N][N] = {0.}; // Initialisation par des 0 + + int i , j; +for(i=0;i