Bonjour
J'ai ecrit le programe suivent en C (exo de TD)
En copilent j'ai les erreur suivente:
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 //calcul des nombres parfaits < = à n #include <stdio.h> int main() {int n,s; printf ("calcul des nombres parfaits jusqu'a "); scanf ("%d",&n); for (int nb=4;nb<=n;nb++) {s=1; for (int d=2; d<=nb/2;d++) {if (nb%d==0) s=s+d;} if (nb == s) printf("%d est parfait \n",nb); } }
Elle sont ou mes fautes?$ gcc -std=c99 parf.c -o parf
parf.c:3:19: erreur: stdio.h : Aucun fichier ou répertoire de ce type
parf.c: In function «main":
parf.c:7: attention : implicit declaration of function «printf"
parf.c:7: attention : incompatible implicit declaration of built-in function «printf"
parf.c:8: attention : implicit declaration of function «scanf"
parf.c:8: attention : incompatible implicit declaration of built-in function «scanf"
merci
Partager