UrbanPro

Learn C++ Language from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

How do I use the logical OR operator (||) in C++?

Asked by Last Modified  

Follow 1
Answer

Please enter your answer

Experienced Computer trainer having worked in IT sector for 20 years.

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...
read more

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
Comments

Make your future bright with me!!!

Logical 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...
read more

Logical 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
Comments

solve Physics and math question in shortcut way

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 more

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 less
Comments

View 1 more Answers

Related Questions

Which are the best books to learn C?
- Yashwant Kanetkar - E Balagurusamy
Kratika
What is iostream.h?
It is a header file, which is needed to be included in C++ program to perform input output operations.
Monisha
Explain about member functions?
Member functions are part of the class, member functions are used to access, member variable in private, protected, public area and also call another member functions.
Zeeshan
0 0
5
What is the syntex error?
A syntax error is a violation of the syntax, or grammatical rules, of a natural language or a programming language. ... A syntax error is called a fatal compilation error, because the compiler cannot translate...
Pranik
What is Enum
An enumeration is a set of named integer constants. An enumerated type is declared using the enum keyword. C# enumerations are value data type. In other words, enumeration contains its own values and cannot inherit or cannot pass inheritance.
S

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Related Lessons

Advantages of C++ Language
Advantages of C++ - C++ is a profoundly convenient dialect and is frequently the dialect of decision for multi-gadget, multi-stage application advancement. - C++ is a protest situated programming dialect...

Upcasting and Downcasting
Converting a derived-class reference or pointer to a base-class reference or pointer is called upcasting. It is always allowed for public inheritance without the need for an explicit type cast. The downcasting,...

Memory Layout of C Programs
A typical memory representation of C program consists of following sections. Text Segment: A text segment, also known as a code segment or simply as text, is one of the sections of a program in an object...

Polymorphism In C++
Basically polymorphism represents poly means many and morph means forms that many forms. In which we are passing same message to different objets but every object will work for that message in their own...

Importance Of Function Prototype In C
Function prototype tells compiler about number of parameters function takes, data-types of parameters and return type of function. By using this information, compiler cross checks function parameters and...

Recommended Articles

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

Read full article >

Almost all of us, inside the pocket, bag or on the table have a mobile phone, out of which 90% of us have a smartphone. The technology is advancing rapidly. When it comes to mobile phones, people today want much more than just making phone calls and playing games on the go. People now want instant access to all their business...

Read full article >

Software Development has been one of the most popular career trends since years. The reason behind this is the fact that software are being used almost everywhere today.  In all of our lives, from the morning’s alarm clock to the coffee maker, car, mobile phone, computer, ATM and in almost everything we use in our daily...

Read full article >

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

Read full article >

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 you
X

Looking for C++ Language Classes?

The best tutors for C++ Language Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn C++ Language with the Best Tutors

The best Tutors for C++ Language Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more