711 views
1 votes
1 votes
What will be the output ?

#include<stdio.h>

int main()
{
    char *str1 = "xyz";
    char *str2 = "xyz";
    if(str1 == str2)
        printf("equal");
    else
        printf("unequal");
    return 0;
}

1 Answer

1 votes
1 votes
string xyz is store two diffrnt memory location and address  of str1 and str2 is diffrent  so if statement become  false  it must return  unequal

Related questions

1 votes
1 votes
2 answers
1
0 votes
0 votes
0 answers
2
shiva0 asked Jan 19, 2019
455 views
int main(){ int a=2,b=2,c=2; printf("%d",a==b==c); return 0;}what is the output??? and what will be done during executioncan anyone explain this……...
1 votes
1 votes
1 answer
3
Harikesh Kumar asked Jan 14, 2018
367 views
step by step compile it and provide output