Does this code:
have any difference with this code:Code://This programme shows an example of if...else statement #include <iostream> #include <string> int main() { using namespace std; string response; cout<< "What is your favorite programming language? "; cin>> response; if (response == "C++") cout<< "You have a great taste. "<< response << " is a great language."; else cout<< "It's not as good as C++, but "<< response<< " is a great programming language too."; return 0; }
If no, which is better?Code://This programme shows an example of if...else statement #include <iostream> #include <string> int main() { using namespace std; string response; cout<< "What is your favorite programming language? "; cin>> response; if (response == "C++") cout<< "You have a great taste. C++ is a great language."; else cout<< "It's not as good as C++, but "<< response<< " is a great programming language too."; return 0; }



LinkBack URL
About LinkBacks



