This commit is contained in:
2025-10-15 16:26:07 +02:00
commit 6565163d11
6 changed files with 240 additions and 0 deletions

35
Exo1.c Normal file
View File

@@ -0,0 +1,35 @@
#include <stdio.h>
TAILLE_TAB = 10000;
int racineCarree(int n){
if (n < 0){
return -2;
}
for(int i = 0; i<n/2 ; i++){
if (i*i == n){
return i ;
}
}
return -1;
}
int racineCarreeTab(int tab[]){
for(int i = 0; i < TAILLE_TAB; i++){
tab[i] = racineCarree(tab[i]);
}
}
int main (void){
int tab[TAILLE_TAB] = {5, 9, 81};
printf("%d \n", racineCarree(10));
racineCarreeTab(tab);
for (int i = 0; i<TAILLE_TAB; i++){
printf("%d ", tab[i]);
}
}