1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
#include<stdio.h>
#include<stdlib.h>
char *Majuscule (char *Pt_Chaine, int Lettre)
{
char *Pt_debut = Pt_Chaine;
while (*Pt_Chaine != '\0')
{
if (*Pt_Chaine == Lettre)
{
*Pt_Chaine = *Pt_Chaine - 32;
}
Pt_Chaine++;
}
return Pt_debut;
}
int main (void)
{
char s[100 + 1];
int c;
printf ("Texte original\n");
fgets (s, sizeof s, stdin);
printf ("Quel est la lettre a modifier :\n");
c = getchar ();
if (c != '\n')
{
getchar ();
}
Majuscule (s, c);
printf ("%s\n", s);
return 0;
} |