Multiple choice technology programming languages

#include int main() { char s1[]="Dennis"; char s2[]="Dennis"; if(s1 == s2) printf(" The man behind C"); else printf(" Experience the legacy of C"); }

  1. The man behind C

  2. Experience the legacy of C

  3. Error : == operator cannot be applied to reference data types

  4. boolean cannot be converted to int

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

In C, comparing two arrays using the == operator compares their memory addresses, not their contents. Even though s1 and s2 contain the same string "Dennis", they are separate arrays stored at different memory locations. Therefore s1 == s2 evaluates to false, and the else branch executes, printing "Experience the legacy of C".