Vidyalelo
C Programming · Q116

Arrays and Strings

Programming · C Programming · question 116

Q116

What will be the output of the following C code? char str1[15]; char str2[15]; int mat; strcpy(str1, "abcdef"); strcpy(str2, "ABCDEF"); mat= strncmp(str1, str2, 4); if(mat 0) printf("str2 is is not greater than str1"); else printf("both are equal");

A.
str1 is not greater than str2
B.
str2 is not greater than str1
Answer
C.
both are equal
D.
error in given code

Answer: Option B

Solution

Answer: Option B
No explanation is given for this question Let's Discuss on Board