I am comparing two string using comparison operators(<,>,=).
The output of "a" < "b" In this case is 0.
#include<iostream>
using namespace std;
int main()
{
cout<<("a" < "a")<<endl;
cout<<("b" < "a")<<endl;
cout<<("a" < "b")<<endl;
return 0;
}
outputs -
0
1
0
But why the output is changing when i am comparing only "a" < "b" ?
#include<iostream>
using namespace std;
int main()
{
// cout<<("a" < "a")<<endl;
// cout<<("b" < "a")<<endl;
cout<<("a" < "b")<<endl;
return 0;
}
output -
1
Here are the SS-
[1st output]https://i.stack.imgur.com/rHqzM.png
[2nd output]https://i.stack.imgur.com/IrUEx.png
I have so confused right now !! pls anyone can assist me with this