#include <stdio.h>
#include <string.h> // Indispensable pour strlen()
int main() {
int compteur = 0, i = 0;
// Correction : guillemets doubles et tableau []
char chaine[] = "quand tu hesite il y des euh et des eeuuh";
for(i = 0; i < strlen(chaine); i++) {
if (chaine[i] == 'e') {
compteur = compteur + 1; // ou compteur++;
}
}
printf("Il y a %d fois la lettre 'e'.\n", compteur);
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: