Developpement/23DEV1.1/CM1/Exo4.c

24 lines
558 B
C
Raw Permalink Normal View History

2024-12-09 11:53:11 +01:00
#include <stdio.h>
#include <stdlib.h>
#define NUMEROS 27
int main(void) {
char tableau[NUMEROS] = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
char find;
int indice;
while(find < 'a' || find > 'z'){
printf("Entrez une lettre minuscule : ");
find = getchar();
}
for(indice = 0 ; indice < NUMEROS ; indice++){
if(tableau[indice] == find){
printf("[%c]", tableau[indice]);
}
else{
printf("%c", tableau[indice]);
}
}
printf("\n");
return EXIT_SUCCESS;
}