Bonsoir à tous,
je dois créer un programme qui calcule pour différent angles (min, max ,et pas) le cos sin et tan. Tout cela en créant une structure Trigo. Le tout doit s'afficher dans un tableau. Voila un peu ce que j'ai commencé :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include <stdio.h>
#include <stdlib.h>
#define N 20
 
 typedef struct {
         double dTabSin[ N];
         double dTabCos[ N];
         double dTabTan[ N];
 int nInf;
 int nStep;
 int nSup;
} TestTrigo ;
 
 void lire (int *pnInf, int *pnStep, int *pnSup)
{
scanf("%d %d %d",*pnInf,*pnStep,*pnSup);
}
 
TestTrigo creer_struct(int nInf, int nStep, int nSup)
{int i,n=0;
for(i=nInf;i<nSup;i=i+nStep)
{stTrigo.dTabSin[n]=sin(i);
stTrigo.dTabCos[n]=cos(i);
stTrigo.dTabTan[n]=tan(i);
n++;
}
 
void afficher_struct (TestTrigo stTrigo)
 {for(n=0;n<N;n++)
printf("%g %g %g\n",stTrigo.dTabSin[n],stTrigo.dTabCos[n],stTrigo.dTabTan[n]);
}
int main(void)
{  
 
  int nInf, nStep, nSup;
  TestTrigo stTrigo;
  int i;
  printf("Table trigo - entrez 3 entiers inf sup step \n-->");
  lire(&nInf,&nStep,&nSup);
  afficher_struct(stTrigo);  
  system("PAUSE");	
  return 0;
}
merci d'avance pour vos réponses