1.

Write a program to print ""hi""

Answer»

Well I'm not sure about what language you want to use. Here is a code for your answer in C++ language. Run the code given below:- #include #include using namespace std; int main(){ string STR; cout<<"Enter a string : "; getline(cin,str); if(str.compare("HI")==0 || str.compare("HI")==0 || str.compare("hI")==0 || str.compare("Hi")==0) { cout<<"Hello"; } else { cout<<"Try with other input"; } return 0; } If you Want to write the program in other language only SYNTAX will change rest logic will remain the same. Hope this will HELP you---Explanation:



Discussion

No Comment Found

Related InterviewSolutions