Mphasis Interview Question

1.Difference between interface and abstract class. 2.Encapsulation and abstraction. 3.Write a program to check if given two strings are anagram or not.

Interview Answer

Anonymous

Sep 19, 2021

anagram: #include using namespace std; int main() { string st1,st2; cin>>st1>>st2; reverse(st1.begin(),st1.end()); if(st1==st2){ cout<<"anagram"; } else cout<<"not ana"; }