Professional Documents
Culture Documents
com
#include <stdio.h>
#include <stdlib.h>
#include<string.h>
int main(void)
{
char mot1[100], mot2[100];
int l, n;
// concaténation
strcat(mot1,mot2);
printf(" Concatenation de mot1 et mot2:\n");
puts(mot1);
// longeur de la concaténation
l=strlen(mot1);
printf(" Longueur de la concatenation:\n%d",l);
// inverser la concatenation
strrev(mot1);
printf("\n Concatenation inverse:\n");
puts(mot1);
// comparaison alphabétique
printf(" Comparaison alphabetique de %s et %s\n",mot1,mot2);
if(strcmp(mot1,mot2)>0) {puts(mot2); puts(mot1);}
if(strcmp(mot1,mot2)==0) printf("identique");
if(strcmp(mot1,mot2)<0) {puts(mot1); puts(mot2);}
printf("\n");
system("PAUSE");
}
1/2
© Mr HousNi * housni14@gmail.com
Capture d'écran
2/2