This commit is contained in:
“[JMF]” 2021-10-21 11:49:39 +02:00
parent ee80bb109d
commit d1b5108653
5 changed files with 55 additions and 0 deletions

Binary file not shown.

1
TP5/data.dat Normal file
View File

@ -0,0 +1 @@
1.000000 1

16
TP5/fileread.c Normal file
View File

@ -0,0 +1,16 @@
#include <stdio.h>
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);
}

14
TP5/filewrite.c Normal file
View File

@ -0,0 +1,14 @@
#include <stdio.h>
int main () {
float a = 1.;
int b = 1 ;
FILE *point = fopen("data.dat","w");
fprintf(point,"%f %d \n",a,b);
fclose(point);
}

24
TP5/tableau2D.c Normal file
View File

@ -0,0 +1,24 @@
#include <stdio.h>
#define N 5
int main () {
float A[N][N] = {0.}; // Initialisation par des 0
int i , j;
for(i=0;i<N;i=i+1)
{
for (j=0;j<N;j++)
{
printf("%f ",A[i][j]);
}
printf("\n");
}
return 1;
}