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

what do you mean scope resulation
According to me Scope resolution operator(::) is used to define a function outside a class or when we want to use a global variable but also has a local variable with same name.
Sunil
What are the toughest topics in C language?
1. pointer 2. dynamic memory allocation 3. File handling
Lokayya
0 0
5
What is a C++ identifier?
The C++ identifier is a name used to identify a variable, function, class, module, or any other user-defined item. An identifier starts with a letter A to Z or a to z or an underscore (_) followed by zero...
T.v.
0 0
6
Explain about protected internal access specifier?
protected access specifier is used in inheritance. Base class members are made accessible to its sub classes through protected access specifier. This access specifier works with in inheritance.
Sahiba
0 0
7
What is meaning of C++?
C++ is an advancement of C language.It is the that language which consists the concepts of OOP or lets say OBJECT ORIENTED PROGRAMMING( OOP ).The benefits of C language as it more secure in programming,...
Moinuddin

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

Ask a Question

Related Lessons

Software Development Training In Jaipur
Satyam Web Solution provides website designing &development and software designing &development training in Jaipur for various stream’s students. MCA 6 month Industrial Training/Internship B....

Do You Know How Is Size Of Structure Defined?
Size of the structure is defined based on multiplies of bigger data type member in the structure. Example: If a structure contains integer, char, short data type, then size of the Structure will be multiples...

Why we need to learn Programming languages?
Language is medium for communication. If two parties like to communicate or exchange the thoughts they must know a language. Language should be understandable by both the Parties. For example A wants to...

C++ Overview
Introduction: C++ is the first object oriented programming language used universally as an advanced version of C language. Many features such as Inheritance, Class & Object, Polymorphism(Function...
N

Namrata Y.

0 0
0

File Handling in C++ : Lesson 1 Data Persistence
Data persistence refers to the existence of data in the program. In other words, it means the life of data. Data is the most significant part of a program and it must be stored properly and easily retrieved...
J

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