Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <ctype.h>
- #include <string.h>
- int main()
- {
- char catsName[50];
- char catsFood[25];
- char sentence[75] = "";
- // puts is awesome way print strings to screen
- // gets is great for getting string from user
- // unlike scanf(), you can have spaces
- puts("Whats that dumb cats name? ");
- gets(catsName);
- puts("What does he eat? ");
- gets(catsFood);
- strcat(sentence, catsName);
- strcat(sentence, " loves to eat ");
- strcat(sentence, catsFood);
- puts(sentence);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment