English, asked by pranathinarra22, 8 months ago

Write a program to print ""hi""

Answers

Answered by latagupta789
1

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<iostream>

#include<string>

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:

Answered by agrimajain08
1

If in HTML :-

If in QBasic :-

If in python :-

If in java :-

HOPE IT HELPS. I KNOW ONLY THESE LANGUAGES

I HAVE WRITTEN ALL IN RESPECTIVE ORDER

Attachments:
Similar questions