What will the following code output? char str1[] = "world"; char str2[] =…
Hexaware · 2024CoCubes · Computer Science · 2024
What will the following code output?
char str1[] = "world";
char str2[] = "hello";
if(strcmp(str1, str2) > 0)
printf("str1 is greater");
else
printf("str2 is greater");
- A.
str1 is greater
- B.
str2 is greater
- C.
Equal strings
- D.
Compilation error
Attempted by 182 students.
Sign up free to check your answer
Sign up freeLoading lesson…