Find the error in each of the following program segments and explain how to correct it "In C" : A) char s[10]; strncpy(s, “hello”, 5); printf(“%s\n”, s); B) printf(“%s”, ‘a’); C) char s[12]; strcpy(s,...


Find the error in each of the following program segments and explain how to correct it "In C" :


A)


char s[10];


strncpy(s, “hello”, 5);


printf(“%s\n”, s);



B) printf(“%s”, ‘a’);



C)


char s[12];


strcpy(s, “Welcome Home”);



D)


if (strcmp(string1, string2)) {


puts(“The strings are equal”);


}



Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here