Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //https://www.facebook.com/AminproPastebin
- #include <stdio.h>
- #include <string.h>
- void swapf(char *ss1, char *ss2);
- int main(void)
- {
- char s1[50], s2[50];
- printf("Enter string 1: ");
- fgets(s1, 50, stdin);
- printf("Enter string 2: ");
- fgets(s2, 50, stdin);
- printf("The ordered words are : \n");
- puts(s1);
- puts(s2);
- swapf(s1, s2);
- return (0);
- }
- void swapf(char *ss1, char *ss2){
- char temp[50];
- if (strcmp(ss1, ss2)> 0){
- strcpy(temp, ss1);
- strcpy(ss1, ss2);
- strcpy(ss2, temp);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement