1.

Find the output of the following after correcting the program? include “stdio.h” include “string.h” main () { char str[80] = “I like c” strcpy (str, “hello”) printf(str) ; }

Answer»

rect FORM of the given code is as follows:#include#include void MAIN () { char str[80] = “I like c”; STRCPY (str, “hello”); printf(str) ; }OUTPUT: helloThe strcpy() function used in the above code is used to copy the content of string to other string. In the above code, it has overwritten the initial value (i.e. """"I like c"""") from the string str and replaced it with """"hello"". Now the content of str is “hello”



Discussion

No Comment Found