This commit is contained in:
Simon SAYE BABU 2022-10-24 23:44:10 +02:00
parent 42f1cb7753
commit 5f4c981021
6 changed files with 213 additions and 0 deletions

14
DEV1.1/TP07/arctique.c Normal file
View File

@ -0,0 +1,14 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main(void){
double r;
double angle;
printf("Rentrez les coordonée du point(espace entre les valeurs:\n");
scanf("%lf %lf",&r,&angle);
printf("x=%lf\n",r*cos(angle));
printf("y=%lf\n",r*sin(angle));
return EXIT_SUCCESS;
}

21
DEV1.1/TP07/distance.c Normal file
View File

@ -0,0 +1,21 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main(void){
double x1;
double x2;
double y1;
double y2;
printf("Rentrez les coordonée du premier point(espace entre les abscisse et ordonnée):\n");
scanf("%lf %lf",&x1,&y1);
printf("\n");
getchar();
printf("Rentrez les coordonée du second point(espace entre les abscisse et ordonnée):\n");
scanf("%lf %lf",&x2,&y2);
printf("\n");
printf("distance : %lf\n", sqrt(pow(x2-x1,2)+pow(y2-y1,2)));
return EXIT_SUCCESS;
}

14
DEV1.1/TP07/formules.c Normal file
View File

@ -0,0 +1,14 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main(void){
printf("%lf\n",sqrt(fabs(log(0.5))));
printf("%lf\n",sin(M_PI/6));
printf("%lf\n",atan(pow(13,2)));
printf("%lf\n",pow(exp(-1),4) );
printf("%lf\n",log(-3) );
printf("%lf\n",pow(sqrt(2),2));
return EXIT_SUCCESS;
}

71
DEV1.1/TP07/horizontal.c Normal file
View File

@ -0,0 +1,71 @@
#include <stdio.h>
#include <stdlib.h>
int main(void){
int tab1[2][5];
int i;
int j;
for(i=0;i<2;i++){
for(j=1;j<=5;j++){
tab1[i][j-1]=j;
}
}
int tab2[3][5];
int nb=1;
for(i=0;i<3;i++){
for(j=0;j<5;j++){
tab2[i][j]=nb;
nb++;
}
}
int tab3[5][5]={0};
nb=0;
for(i=0;i<5;i++){
for(j=1;j<=nb;j++){
tab3[i][j-1]=j;
}
nb++;
}
printf("%10s %17s %17s\n", "t1","t2","t3");
for(i=0;i<5;i++){
if(i<2){
for(j=0;j<5;j++){
printf("%3d",tab1[i][j]);
}
printf(" ");
for(j=0;j<5;j++){
printf("%3d",tab2[i][j]);
}
printf(" ");
for(j=0;j<5;j++){
printf("%3d",tab3[i][j]);
}
printf("\n");
}
if(i==2){
printf(" ");
for(j=0;j<5;j++){
printf("%3d",tab2[i][j]);
}
printf(" ");
for(j=0;j<5;j++){
printf("%3d",tab3[i][j]);
}
printf("\n");
}
if(i>2){
printf(" ");
for(j=0;j<5;j++){
printf("%3d",tab3[i][j]);
}
printf("\n");
}
}
return EXIT_SUCCESS;
}

56
DEV1.1/TP07/progression.c Normal file
View File

@ -0,0 +1,56 @@
#include <stdio.h>
#include <stdlib.h>
int main(void){
/*
int tab[2][5];
int i;
int j;
for(i=0;i<2;i++){
for(j=1;j<=5;j++){
tab[i][j-1]=j;
}
}
for(i=0;i<2;i++){
for(j=0;j<5;j++){
printf("%d ",tab[i][j]);
}
printf("\n");
}
int tab[3][5];
int i;
int j;
int nb=1;
for(i=0;i<3;i++){
for(j=0;j<5;j++){
tab[i][j]=nb;
nb++;
}
}
for(i=0;i<3;i++){
for(j=0;j<5;j++){
printf("%d ",tab[i][j]);
}
printf("\n");
}
*/
int tab[5][5]={0};
int i;
int j;
int nb=0;
for(i=0;i<5;i++){
for(j=1;j<=nb;j++){
tab[i][j-1]=j;
}
nb++;
}
for(i=0;i<5;i++){
for(j=0;j<5;j++){
printf("%d ",tab[i][j]);
}
printf("\n");
}
return EXIT_SUCCESS;
}

37
DEV1.1/TP07/triangle.c Normal file
View File

@ -0,0 +1,37 @@
#include <stdio.h>
#include <stdlib.h>
int main(void){
int tab1[30][30]={0};
int i;
int j;
int nb=1;
for(i=0;i<30;i++){
for(j=0;j<nb;j++){
if(j>0&&i>0){
tab1[i][j]=tab1[i-1][j]+tab1[i-1][j-1];
}
else{
if(i==0){
tab1[i][j]=1;
}
else{
if(j>=0){
tab1[i][j]=1;
}
}
}
}
nb++;
}
nb = 1;
for(i=0;i<30;i++){
for(j=0;j<nb;j++){
printf("%5d",tab1[i][j]);
}
printf("\n");
nb++;
}
return EXIT_SUCCESS;
}