📚 Practice Mode

C Programming Fundamentals

Learn at your own pace with hints and detailed explanations

1 / 19
Multiple Choice

What would be the output of the following program?

main()
{
char *str,*str1="I Love You";
str=malloc(strlen(str1));
strcpy(str,str1);
printf("%s",str);
free(str);
}

  1. free() fails
  2. I Love You
  3. malloc() fails
  4. strcpy() fails