├── ft_swap.c ├── hello.c ├── ft_strlen.c ├── ft_countdown.c ├── max.c ├── ft_print_numbers.c ├── nospace.c ├── first_word.c ├── ft_strcmp.c ├── rev_print.c ├── ft_strrev.c ├── ft_strdup.c ├── wdmatch.c ├── do_op.c ├── union.c ├── repeat_alpha.c ├── rotone.c ├── inter.c ├── ft_atoi.c ├── rot_13.c ├── search_and_replace.c ├── alpha_mirror.c ├── ft_ctrcpy.c ├── ft_putstr.c ├── print_bits.c └── README.md /ft_swap.c: -------------------------------------------------------------------------------- 1 | void ft_swap(int *a, int *b) 2 | { 3 | int temp; 4 | 5 | temp = *a; 6 | *a = *b; 7 | *b = temp; 8 | } 9 | -------------------------------------------------------------------------------- /hello.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(void) 4 | { 5 | write(1, "Hello World!\n", 13); 6 | return (0); 7 | } 8 | -------------------------------------------------------------------------------- /ft_strlen.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int ft_strlen(char *str) 4 | { 5 | int i = 0; 6 | while(str[i] != '\0') 7 | { 8 | i++; 9 | } 10 | return(i); 11 | } 12 | -------------------------------------------------------------------------------- /ft_countdown.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(void) 4 | { 5 | char a = '9'; 6 | 7 | while (a >= '0') 8 | { 9 | write(1,&a,1); 10 | a--; 11 | } 12 | write(1, "\n", 1); 13 | return (0); 14 | } 15 | -------------------------------------------------------------------------------- /max.c: -------------------------------------------------------------------------------- 1 | int max(int* tab, unsigned int len) 2 | { 3 | int i = 1; 4 | int max = 0; 5 | 6 | max = tab[0]; 7 | while(i <= len) 8 | { 9 | if(tab[i]>max) 10 | max = tab[i] 11 | i++; 12 | } 13 | return (max); 14 | } 15 | -------------------------------------------------------------------------------- /ft_print_numbers.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void ft_print_numbers(void) 4 | { 5 | char z; 6 | z = '0'; 7 | 8 | while (z <= '9') 9 | { 10 | write(1, &z, 1); 11 | z++; 12 | } 13 | } 14 | 15 | int main(void) 16 | { 17 | ft_print_numbers(); 18 | return (0); 19 | } 20 | -------------------------------------------------------------------------------- /nospace.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(int argc, char **argv) 4 | { 5 | int i = 0; 6 | 7 | if(argc == 2) 8 | { 9 | while (argv[1][i] != '\0') 10 | { 11 | if (argv[1][i] == ' ') 12 | i++; 13 | write(1, &argv[1][i], 1); 14 | i++; 15 | } 16 | } 17 | write(1,"\n",1); 18 | return (0); 19 | } 20 | -------------------------------------------------------------------------------- /first_word.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(int argc, char **argv) 4 | { 5 | int i = 0; 6 | 7 | if(argc == 2) 8 | { 9 | while (argv[1][i] == ' ' || argv[1][i] == '\t') 10 | { 11 | i++; 12 | } 13 | while (argv[1][i] != ' ' && argv[1][i] != '\t' && argv[1][i] != '\0') 14 | { 15 | write(1, &argv[1][i], 1); 16 | i++; 17 | } 18 | } 19 | write(1,"\n",1); 20 | return (0); 21 | } 22 | -------------------------------------------------------------------------------- /ft_strcmp.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int ft_strcmp(char *s1, char *s2) 6 | { 7 | int i = 0; 8 | 9 | while((s1[i] == s2[i]) && s1[i] && s2[i]) 10 | i++; 11 | return (s1[i]-s2[i]); 12 | } 13 | 14 | int main(int argc, char **argv) 15 | { 16 | argc = argc + 0; 17 | printf("%d\n", ft_strcmp(argv[1], argv[2])); 18 | printf("%d\n", strcmp(argv[1], argv[2])); 19 | 20 | 21 | return (0); 22 | } 23 | -------------------------------------------------------------------------------- /rev_print.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void ft_putchar(char c) 4 | { 5 | write(1, &c, 1); 6 | } 7 | 8 | int ft_rev(char *str) 9 | { 10 | int i = 0; 11 | while(str[i] != '\0') 12 | { 13 | i++; 14 | } 15 | while(i > 0) 16 | { 17 | i--; 18 | ft_putchar(str[i]); 19 | } 20 | return(0); 21 | } 22 | 23 | int main(int argc, char **argv) 24 | { 25 | if(argc == 2) 26 | { 27 | ft_rev(argv[1]); 28 | } 29 | ft_putchar('\n'); 30 | return(0); 31 | } 32 | -------------------------------------------------------------------------------- /ft_strrev.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | char *ft_strrev(char *str) 4 | { 5 | 6 | 7 | 8 | int i = 0; 9 | int j = 0; 10 | char buff; 11 | while(str[i]) 12 | i++; 13 | i--; 14 | while(j 2 | #include 3 | 4 | char *ft_strdup(char *src) 5 | { 6 | int i = 0; 7 | char *res; 8 | 9 | while(src[i]) 10 | i++; 11 | res = (char*)malloc(sizeof(*res) * i + 1); 12 | if (res == NULL) 13 | return (NULL); 14 | i = 0; 15 | while(src[i]) 16 | { 17 | res[i]=src[i]; 18 | i++; 19 | } 20 | res[i] = '\0'; 21 | return (res); 22 | } 23 | 24 | int main(void) 25 | { 26 | 27 | printf("%s", ft_strdup("hello")); 28 | return (0); 29 | } 30 | -------------------------------------------------------------------------------- /wdmatch.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | static char *wdmatch(char *str1, const char *str2) 4 | { 5 | while (*str1 != '\0' && *str2 != '\0') 6 | { 7 | if (*str1 == *str2) 8 | str1++; 9 | str2++; 10 | } 11 | if (*str1 == '\0') 12 | return (str1); 13 | return (NULL); 14 | } 15 | 16 | int main(int argc, char **argv) 17 | { 18 | char *tmp; 19 | 20 | if (argc == 3) 21 | { 22 | tmp = wdmatch(argv[1], argv[2]); 23 | if (tmp != NULL) 24 | write(1, argv[1], tmp - argv[1]); 25 | } 26 | write(1, "\n", 1); 27 | return (0); 28 | } 29 | -------------------------------------------------------------------------------- /do_op.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main (int argc, char **argv) 5 | { 6 | int arg1 = 0; 7 | int arg2 = 0; 8 | if (argc == 4) 9 | { 10 | arg1 = atoi(argv[1]); 11 | arg2 = atoi(argv[3]); 12 | 13 | if(argv[2][0]=='+') 14 | { 15 | printf("%d", arg1 + arg2); 16 | } 17 | if(argv[2][0]=='-') 18 | { 19 | printf("%d", arg1 - arg2); 20 | } 21 | if(argv[2][0]=='/') 22 | { 23 | printf("%d", arg1 / arg2); 24 | } 25 | if(argv[2][0]=='%') 26 | { 27 | printf("%d", arg1 % arg2); 28 | } 29 | } 30 | printf("\n"); 31 | return (0); 32 | } 33 | -------------------------------------------------------------------------------- /union.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void ft_union(char *str, char *str2) 4 | { 5 | int tab[256] = {0}; 6 | int a; 7 | 8 | a = 0; 9 | while (str[a]) 10 | { 11 | if (tab[(int)str[a]] == 0) 12 | { 13 | tab[(int)str[a]] = 1; 14 | write (1, &str[a], 1); 15 | } 16 | a++; 17 | } 18 | a = 0; 19 | while (str2[a]) 20 | { 21 | if (tab[(int)str2[a]] == 0) 22 | { 23 | tab[(int)str2[a]] = 1; 24 | write(1, &str2[a], 1); 25 | } 26 | a++; 27 | } 28 | } 29 | 30 | int main (int ac, char **av) 31 | { 32 | if (ac == 3) 33 | ft_union(av[1], av[2]); 34 | write(1, "\n", 1); 35 | return (0); 36 | } 37 | -------------------------------------------------------------------------------- /repeat_alpha.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(int argc, char **argv) 4 | { 5 | int i = 0; 6 | int j = 0; 7 | char a = 'a'; 8 | if(argc == 2) 9 | { 10 | while(argv[1][i] != '\0') 11 | { 12 | a = argv[1][i]; 13 | if (a >= 'A' && a <= 'Z') 14 | { 15 | while(j < (a - 64)) 16 | { 17 | write(1, &argv[1][i], 1); 18 | j++; 19 | } 20 | j = 0; 21 | } 22 | else if (argv[1][i] >= 'a' && argv[1][i] <= 'z') 23 | { 24 | while(j < (a - 96)) 25 | { 26 | write(1, &a, 1); 27 | j++; 28 | } 29 | j = 0; 30 | } 31 | write(1, &a, 1); 32 | i++; 33 | } 34 | } 35 | write(1, "\n", 1); 36 | return (0); 37 | } 38 | -------------------------------------------------------------------------------- /rotone.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | 4 | int main(int argc, char **argv) 5 | { 6 | int i = 0; 7 | char a = 'a'; 8 | if(argc == 2) 9 | { 10 | while (argv[1][i] != '\0') 11 | { 12 | a = argv[1][i]; 13 | if((a >= 97 && a <= 121) || (a >= 65 && a <= 89)) 14 | { 15 | a = a + 1; 16 | write(1, &a, 1); 17 | } 18 | else if(a == 122) 19 | { 20 | a = 97; 21 | write(1, &a, 1); 22 | } 23 | else if(a == 90) 24 | { 25 | a = 65; 26 | write(1, &a, 1); 27 | } 28 | else if(!((a >= 97 && a <= 121) || (a >= 65 && a <= 89))) 29 | { 30 | write(1, &a, 1); 31 | } 32 | i++; 33 | } 34 | } 35 | write(1,"\n",1); 36 | return (0); 37 | } 38 | -------------------------------------------------------------------------------- /inter.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(int argc, char **argv) 4 | { 5 | int i = 0; 6 | int j = 0; 7 | int tab[256] = {0}; 8 | if(argc == 3) 9 | { 10 | 11 | // 12 | // 13 | // 14 | 15 | 16 | 17 | 18 | while(argv[1][i]) 19 | { 20 | j = 0; 21 | while(argv[2][j]) // checks to see repeating characters 22 | { 23 | if(argv[2][j] == argv[1][i]) // if there is a repeating character, execute the next lines 24 | { 25 | 26 | if(tab[(int)argv[1][i]] == 0) 27 | { 28 | tab[(int)argv[1][i]] = 1; 29 | write(1, &argv[2][j], 1); 30 | } 31 | } 32 | j++; 33 | } 34 | i++; 35 | } 36 | } 37 | write(1,"\n",1); 38 | return (0); 39 | } 40 | -------------------------------------------------------------------------------- /ft_atoi.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int ft_atoi(const char *str) 5 | { 6 | int i = 0; 7 | int neg_flag = 1; 8 | int res = 0; 9 | if(str[i]=='-') 10 | { 11 | if(str[i+1]=='+') 12 | return (0); 13 | neg_flag = -1; 14 | i++; 15 | } 16 | if((str[i]<48 || str[i]>57) && str[i] != '+') 17 | return (0); 18 | if(str[i]=='+') 19 | i++; 20 | while ((str[i] != '\0') && (str[i] >= '0') && (str[i] <= '9')) 21 | { 22 | res = res * 10 + (str[i] - 48); 23 | i++; 24 | } 25 | res *= neg_flag; 26 | return(res); 27 | } 28 | 29 | int main(int argc, char **argv) 30 | { 31 | argc += 0; 32 | printf("%d\n", ft_atoi(argv[1])); 33 | printf("%d\n", atoi(argv[1])); 34 | return (0); 35 | 36 | } 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /rot_13.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(int argc, char **argv) 4 | { 5 | int i = 0; 6 | char a = 'a'; 7 | if (argc == 2) 8 | { 9 | while(argv[1][i] != '\0') 10 | { 11 | a = argv[1][i]; 12 | if(a >= 65 && a <= 77)// uppercase 13 | { 14 | a = a + 13; 15 | write(1, &a, 1); 16 | } 17 | else if(a>77 && a <=90) 18 | { 19 | a = a - 13; 20 | write(1,&a, 1); 21 | } 22 | else if(a>=97 && a<=109)//lowercase 23 | { 24 | a = a+13; 25 | write(1, &a, 1); 26 | } 27 | else if (a>109 && a<123) 28 | { 29 | a = a - 13; 30 | write(1, &a, 1); 31 | } 32 | if( !((a>= 65 && a<=90) || (a>=97 && a<=122)) ) 33 | { 34 | write(1, &a, 1); 35 | } 36 | i++; 37 | } 38 | } 39 | write(1,"\n",1); 40 | return (0); 41 | } 42 | -------------------------------------------------------------------------------- /search_and_replace.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main (int argc, char **argv) 4 | { 5 | int i = 0; 6 | 7 | 8 | if(argv[2][1] != '\0' || argv[3][1] != '\0') //checks if args 2 and 3 are only one character 9 | { 10 | write(1,"\n",1); 11 | return (0); 12 | } 13 | if(argc == 4) 14 | { 15 | if (((argv[2][0] > 64 && argv[2][0] < 91) || (argv[2][0]>96&&argv[2][0]<123) ) && ( (argv[3][0] > 64 && argv[3][0] < 91) || (argv[3][0]>96&&argv[3][0]<123) ))//checks if args 2 and 3 are valid letters 16 | { 17 | while(argv[1][i] != '\0') 18 | { 19 | if(argv[1][i] == argv[2][0]) 20 | { 21 | write (1, &argv[3][0],1); 22 | } 23 | else 24 | write(1,&argv[1][i],1); 25 | i++; 26 | } 27 | } 28 | else 29 | { 30 | write(1, "\n", 1); 31 | return (0); 32 | } 33 | } 34 | write(1,"\n",1); 35 | return (0); 36 | } 37 | -------------------------------------------------------------------------------- /alpha_mirror.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(int argc, char **argv) 4 | { 5 | int i = 0; 6 | int count = 0; 7 | char in = 'a'; 8 | char a = 'a'; 9 | char A = 'A'; 10 | if(argc == 2) 11 | { 12 | while(argv[1][i] != '\0') 13 | { 14 | in = argv[1][i]; 15 | if(in >= 'a' && in <= 'z') 16 | { 17 | while(a != in) 18 | { 19 | a++; 20 | count++; 21 | } 22 | count *= 2; //count = count*2 23 | a = 'a'; 24 | in += 25 - count; 25 | write(1, &in, 1); 26 | count = 0; 27 | } 28 | else if(in >= 'A' && in <= 'Z') 29 | { 30 | while(A != in) 31 | { 32 | A++; 33 | count++; 34 | } 35 | count *= 2; 36 | A = 'A'; 37 | in += 25 -count; 38 | write(1, &in, 1); 39 | count = 0; 40 | } 41 | else 42 | write(1, &in, 1); 43 | i++; 44 | } 45 | } 46 | write(1,"\n",1); 47 | return (0); 48 | } 49 | -------------------------------------------------------------------------------- /ft_ctrcpy.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* ft_ctrcpy.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: jdaguna +#+ +:+ +#+ */ 7 | /* +#+#+#+#+#+ +#+ */ 8 | /* Created: 2018/01/30 23:14:14 by jdaguna #+# #+# */ 9 | /* Updated: 2018/01/30 23:22:21 by jdaguna ### ########.fr */ 10 | /* */ 11 | /* ************************************************************************** */ 12 | 13 | #include 14 | 15 | char *ft_strcpy(char *s1, char *s2)// s1 = dest, s2 = source 16 | { 17 | int i; 18 | 19 | i = 0; 20 | while (s2[i] != '\0') 21 | { 22 | s1[i] = s2[i]; 23 | i++; 24 | } 25 | s1[i] = '\0'; 26 | return (s1); 27 | } 28 | -------------------------------------------------------------------------------- /ft_putstr.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* ft_putstr.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: jdaguna +#+ +:+ +#+ */ 7 | /* +#+#+#+#+#+ +#+ */ 8 | /* Created: 2018/01/30 23:09:00 by jdaguna #+# #+# */ 9 | /* Updated: 2018/01/30 23:12:40 by jdaguna ### ########.fr */ 10 | /* */ 11 | /* ************************************************************************** */ 12 | 13 | #include 14 | 15 | void ft_putstr(char *str) 16 | { 17 | int i; 18 | 19 | i = 0; 20 | while (str[i] != '\0') 21 | { 22 | write(1, &str[i], 1); 23 | i++; 24 | } 25 | } 26 | 27 | int main(void) 28 | { 29 | ft_putstr("ppduhjwhefbi"); 30 | return(0); 31 | } 32 | 33 | 34 | -------------------------------------------------------------------------------- /print_bits.c: -------------------------------------------------------------------------------- 1 | /* ************************************************************************** */ 2 | /* */ 3 | /* ::: :::::::: */ 4 | /* print_bits.c :+: :+: :+: */ 5 | /* +:+ +:+ +:+ */ 6 | /* By: vquesnel +#+ +:+ +#+ */ 7 | /* +#+#+#+#+#+ +#+ */ 8 | /* Created: 2016/03/21 12:58:19 by vquesnel #+# #+# */ 9 | /* Updated: 2018/02/01 00:41:09 by jdaguna ### ########.fr */ 10 | /* */ 11 | /* ************************************************************************** */ 12 | 13 | #include 14 | 15 | void print_bits(unsigned char octet) 16 | { 17 | int n; 18 | 19 | n = 128; 20 | while (n > 0) 21 | { 22 | if (octet & n) 23 | write(1, "1", 1); 24 | else 25 | write(1, "0", 1); 26 | n /= 2; 27 | } 28 | } 29 | 30 | int main(void) 31 | { 32 | unsigned char c = 4; 33 | print_bits(c); 34 | 35 | } 36 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # C-42-exam-prep 2 | 3 | ## alpha_mirror.c 4 | Takes a string and displays the string after replacing each alphabetical character by the opposite alphabetical character, followed by a newline. 5 | 'a' becomes 'z', 'Z' becomes 'A' 6 | 'd' becomes 'w', 'M' becomes 'N' 7 | Case is not changed. 8 | 9 | ## do_op.c 10 | Write a program that takes three strings: 11 | - The first and the third one are representations of base-10 signed 12 | integers that fit in an int. 13 | - The second one is an arithmetic operator chosen from: + - * / % 14 | The program displays the result of the requested arithmetic 15 | operation, followed by a newline. If the number of parameters is not 3, the 16 | program just displays a newline. 17 | You can assume the string have no mistakes or extraneous characters. 18 | Negative numbers, in input or output, will have one and only one leading '-'. 19 | The result of the operation fits in an int. 20 | 21 | ## first_word.c 22 | Write a program that takes a string and displays its first word, followed by a newline. 23 | A word is a section of string delimited by spaces/tabs or by the start/end of the string. 24 | 25 | ## ft_atoi.c 26 | Write a program that takes three strings: 27 | - The first and the third one are representations of base-10 signed 28 | integers that fit in an int. 29 | - The second one is an arithmetic operator chosen from: + - * / % 30 | The program must display the result of the requested arithmetic 31 | operation, followed by a newline. If the number of parameters is not 3, the 32 | program just displays a newline. 33 | You can assume the string have no mistakes or extraneous characters. 34 | Negative numbers, in input or output, will have one and only one leading '-'. 35 | The result of the operation fits in an int. 36 | 37 | ## ft_countdown.c 38 | Write a program that displays all digits in descending order, followed 39 | by a newline. 40 | 41 | ## ft_ctrcpy.c 42 | Reproduce the behavior of the function strcpy (man strcpy). 43 | 44 | ## ft_print_numbers.c 45 | Write a function that displays all digits in ascending order. 46 | 47 | ## ft_putstr.c 48 | Write a function that displays a string on the standard output. 49 | The pointer passed to the function contains the address of the 50 | string's first character. 51 | 52 | ## ft_strcmp.c 53 | Reproduce the behavior of the function strcmp (man strcmp). 54 | 55 | ## ft_strdup.c 56 | Reproduce the behavior of the function strdup (man strdup). 57 | 58 | ## ft_strlen.c 59 | Write a function that returns the length of a string. 60 | 61 | ## ft_sttrev.c 62 | Write a function that reverses (in-place) a string. 63 | It must return its parameter. 64 | 65 | ## ft_swap.c 66 | Write a function that swaps the contents of two integers the adresses 67 | of which are passed as parameters. 68 | 69 | ## hello.c 70 | Write a program that displays "Hello World!" followed by a \n. 71 | 72 | ## inter.c 73 | Write a program that takes two strings and displays, without doubles, 74 | the characters that appear in both strings, in the order they appear in the first one. The display will be followed by a \n. 75 | If the number of arguments is not 2, the program displays \n. 76 | 77 | ## max.c 78 | The first parameter is an array of int, the second is the number of 79 | elements in the array. 80 | The function returns the largest number found in the array. 81 | If the array is empty, the function returns 0. 82 | 83 | ## nospace.c 84 | Removes all spaces in a given parameter and displays the result. 85 | 86 | ## print_bits.c 87 | Write a function that takes a byte, and prints it in binary WITHOUT A NEWLINE AT THE END. 88 | Your function must be declared as follows:
 89 | repeat_alpha.c 90 | Write a program called repeat_alpha that takes a string and display it repeating each alphabetical character as many times as its alphabetical index, followed by a newline. 91 | 'a' becomes 'a', 'b' becomes 'bb', 'e' becomes 'eeeee', etc... 92 | Case remains unchanged. 93 | If the number of arguments is not 1, just display a newline. 94 | 95 | ## rev_print.c 96 | Write a program that takes a string, and displays the string in reverse followed by a newline. 97 | If the number of parameters is not 1, the program displays a newline. 98 | 99 | ## rot_13.c 100 | Write a program that takes a string and displays it, replacing each of its letters by the letter 13 spaces ahead in alphabetical order. 101 | 'z' becomes 'm' and 'Z' becomes 'M'. Case remains unaffected. 102 | The output will be followed by a newline. 103 | If the number of arguments is not 1, the program displays a newline. 104 | 105 | ## rotone.c 106 | Write a program that takes a string and displays it, replacing each of its 107 | letters by the next one in alphabetical order. 108 | 'z' becomes 'a' and 'Z' becomes 'A'. Case remains unaffected. 109 | The output will be followed by a \n. 110 | If the number of arguments is not 1, the program displays \n. 111 | 112 | ## search_and_replace.c 113 | Write a program called search_and_replace that takes 3 arguments, the first arguments is a string in which to replace a letter (2nd argument) by another one (3rd argument). 114 | If the number of arguments is not 3, just display a newline. 115 | If the second argument is not contained in the first one (the string) then the program simply rewrites the string followed by a newline. 116 | 117 | ## union.c 118 | Write a program that takes two strings and displays, without doubles, the characters that appear in either one of the strings. 119 | The display will be in the order characters appear in the command line, and will be followed by a \n. 120 | If the number of arguments is not 2, the program displays \n. 121 | 122 | ## wdmatch.c 123 | Write a program that takes two strings and checks whether it’s possible to write the first string with characters from the second string, while 124 | respecting the order in which these characters appear in the second string. 125 | If it's possible, the program displays the string, followed by a \n, otherwise it simply displays a \n. If the number of arguments is not 2, the program displays a \n. 126 | --------------------------------------------------------------------------------