#include <stdio.h>
#include <string.h>
int main()
{
char *nameAnimal = (char*) malloc(50*sizeof(char));
char *nameBird = (char*) malloc(50*sizeof(char));
int n;
printf("Enter name of animal: ");
gets(nameAnimal);
printf("Enter name of animal: ");
gets(nameBird);
strncat(nameAnimal,"s", 1);
strncat(nameBird,"s", 1);
printf("\nNames in plural are: %s, %s\n",nameAnimal,nameBird);
free(nameAnimal);
free(nameBird);
scanf("%d",&n);
return 0;
}
Comments
Leave a comment