write code to use strcpy to copy a string from variable A wh

write code to use strcpy to copy a string from variable A where A contains the data \"Greetings friend\" to B

Solution

Copy.c

#include <stdio.h>
#include <string.h>
int main()
{
char A[100] = \"Greetings friend\";
char B[100];
strcpy(B, A);
printf(\"A = %s\ \", A);
printf(\"B = %s\ \", B);

return 0;
}

Output:

sh-4.3$ gcc -o main *.c                                                                                                                                                                                                     

sh-4.3$ main                                                                                                                                                                                                                

A = Greetings friend                                                                                                                                                                                                        

B = Greetings friend

write code to use strcpy to copy a string from variable A where A contains the data \

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site