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

how to use dos.h
First include dos.h header file then use their function. Before use function, you must have knowledge of dos functions and their charactistics
Aman
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
Is it possible to write big safe programs in C++?
yes. C++ is generally used to write system software. For example windows operating system are writeen in C++. Most of the operating system, device driver and antivirus programs are written by using C++.
Sapna
0 0
6
What is the actual size of INT in the C language, 2 or 4 bytes?
The actual size to int is determined by the compiler as the program runs. But theoretically the size is 2 bytes. You can increase the size by adding keyword long infront of it to make the size 4 bytes. Eg int a; // 2 bytes Long int b; // 4 bytes
Kunal

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

Ask a Question

Related Lessons

C, C++, JAVA Tutor
* Program to swap two numbers using a temporary variable with each statement explained with comments * #include // headerfile for cout statement using namespace std; //...

Do You Know Size Of Empty Class and Reason?
Size of empty class is always 1 byte. Reason is, in order to differentiate one object to another object, the size of empty class is always 1 byte. See the below c++ code snippet. Here there are three...

C++ Program-Working with constant using const keyword
//Header files #include<iostream.h>#include<conio.h> //Main function void main(){ //using const keyword to declare constants with a specific type const int len=10; const int br=5; const...
S

Is It Fine To Write “void main()” Or “main()” In C/C++?
The definition: void main() { /* ... */ } Is not and never has been C++, nor has it even been C. See the ISO C++ standard 3.6.1 or the ISO C standard 5.1.2.2.1. A conforming...

C++ Fundamentals - Introduction
Introduction to C++ C++ CHARACTER SET It is the set of all valid characters that a language can recognize . It represents any letter, digit, or any other sign .C++ character set: LETTERS...
R

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