l8.c 449 B

123456789101112131415161718192021
  1. #include <stdio.h>
  2. #include <string.h>
  3. int main() {
  4. char pol[100];
  5. printf("Enter word ");
  6. scanf("%s", pol);
  7. char x[100] = "hello";
  8. x[0] = 'H';
  9. x[1] = 'i';
  10. strcpy(&x[2], &x[5]);
  11. strcat(x, "!");
  12. if(strcmp(x, pol) == 0) {
  13. printf("equal\n");
  14. }
  15. else {
  16. printf("not equal\n");
  17. }
  18. int len = strlen(x), len2 = strlen(pol);
  19. printf("Symbol: %d\n%s\nSymbol your word: %d", len, x, len2);
  20. }