Learn C++ Language from the Best Tutors
Search in
int main()
{
int x = 5 ;
int y = 15 ;
cout << ((x == 0) || (x > y)) << endl ; // False || False = False
cout << ((x == 0) || (x < y)) << endl ; // False || True = True
cout << ((x == 5) || (x > y)) << endl ; // True || False = True
cout << ((x == 5) || (x < y)) << endl ; // True || True = True
return 0;
}
read lessLogical operators are used to check whether an expression is True or False.
example:
int main()
{
int x = 5 ;
int y = 15 ;
cout << ((x == 0) || (x > y)) << endl ; // False || False = False
cout << ((x == 0) || (x < y)) << endl ; // False || True = True
cout << ((x == 5) || (x > y)) << endl ; // True || False = True
cout << ((x == 5) || (x < y)) << endl ; // True || True = True
return 0;
}
read less
Logical operators are used to check whether an expression is True or False. After using Logical Operators on the variables, the result returned is a Boolean Value i.e., Either a True or False value. By default, the operand values are converted into type Boolean and then compared and computed.
read lessView 1 more Answers
Related Questions
Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com
Ask a QuestionRecommended Articles
About C++ Programming Language
Introduction C++ is an excellent programming language and many of the applications are written in C++ language. It has generic, object-oriented & imperative programming features, and also provides facilities for low-level memory manipulation. Successor of C language, it is an OOP (object oriented programming) language...
Learn Microsoft Excel
Microsoft Excel is an electronic spreadsheet tool which is commonly used for financial and statistical data processing. It has been developed by Microsoft and forms a major component of the widely used Microsoft Office. From individual users to the top IT companies, Excel is used worldwide. Excel is one of the most important...
Why Should you Become an IT Consultant
Information technology consultancy or Information technology consulting is a specialized field in which one can set their focus on providing advisory services to business firms on finding ways to use innovations in information technology to further their business and meet the objectives of the business. Not only does...
8 Hottest IT Careers of 2014!
Whether it was the Internet Era of 90s or the Big Data Era of today, Information Technology (IT) has given birth to several lucrative career options for many. Though there will not be a “significant" increase in demand for IT professionals in 2014 as compared to 2013, a “steady” demand for IT professionals is rest assured...
Looking for C++ Language Classes?
Learn from the Best Tutors on UrbanPro
Are you a Tutor or Training Institute?
Join UrbanPro Today to find students near youThe best tutors for C++ Language Classes are on UrbanPro
The best Tutors for C++ Language Classes are on UrbanPro